• I have some user defined functions. All works as expected. But I have to click and write a lot until a function is activated for a block. Is there a shorter way to do this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author wickedplugins

    (@wickedplugins)

    Hi @hupe13,

    Can you give me a bit more details on what you mean by having to click and write a lot for the function to be activated?

    Thread Starter hupe13

    (@hupe13)

    My website is https://leafext.de. I have two functions:

    function englisch () {
    	if (get_locale() != "de_DE" ) {
    		return true;
    	} else {
    		return false;
    	}
    }
    function deutsch () {
    	if (get_locale() != "de_DE" ) {
    		return false;
    	} else {
    		return true;
    	}
    }

    I add a new (one) post for both german and english speaking visitors. If they call https://leafext.de they get the german content, if they call https://leafext.de/en/ they get the english content. So I write the headers and the text blocks both in german and in english. For each these blocks I make a condition:

    • I click “Display Conditions”
    • I click “Add Condition”
    • I click “Check a user defined function”
    • I write in the function field “deutsch” or “englisch”
    • I click “save”

    Is it possible to simplify steps 2-4 and combine them into one once done? Similar to custom fields. After using them once, they are ready to use afterwards.

    Plugin Author wickedplugins

    (@wickedplugins)

    Thanks for the additional info. So do you think something like the ability to save a condition that could be added to other blocks would do the trick?

    So perhaps it would work something like this:

    • When creating a new condition, have the ability to save the condition to your library
    • Click “Display Conditions” on a new block
    • Click “Add Condition”
    • Choose a previously-saved condition to add

    Would that help?

    Thread Starter hupe13

    (@hupe13)

    Yes, something like that.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘User defined functions’ is closed to new replies.