How to store multiple instances of the plugin’s options for various shortcodes
How to store multiple instances of the plugin’s options for various shortcodes
How to store multiple instances of the plugin’s options for various shortcodes
I fixed it, I installed a new version of clean wordpress and transferred db (dumped db using phpmyadmin), and also plugins folder and theme folder, and it start working
Something like this? if(current_user_can(‘administrator’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; }elseif(current_user_can(‘subscriber’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; } Maybe this should be wrapped in a user logged in check like this: if(is_user_logged_in()){ if(current_user_can(‘administrator’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; }elseif(current_user_can(‘subscriber’)){ echo ‘<option value=”[email protected]”>[email protected]</option>’; } }
How do I add a textarea (multirow) option to my WordPress plugin?
How to detect if i am on plugin’s settings page
I needed something like array($this, ‘field_callback’) instead of just the string ‘field_callback’ inside the add_settings_xxx functions. I am still seeking an explanation for this solution if you can enlighten me. Why does this work?
Protect WordPress option value
$postids = get_option(‘codeable_posts_field’); This will give you a string of comma separated post ids (according to your code, and if the user follows the instructions). array( $postids ) will turn it into an array with that string as the only element. That won’t work with is_single(), obviously, because is_single doesn’t do any further splitting. Here’s … Read more
Strange Behavior with update_option
Solved: Add these code to the functions.php file of your subsite’s theme, immediately after the initial ” AND READ THIS, BEFORE USING: https://codex.wordpress.org/Changing_The_Site_URL#Edit_functions.php if ( ! is_admin() ) { $xsiteurl = get_option( ‘home’ ); $find = array( ‘http://’, ‘https://’ ); if ( $find != ‘http://’ ) { $replace=””; $pureaddress = str_replace( $find, $replace, $xsiteurl ); … Read more