Echo Option Value Based On WordPress User Role

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>’; } }

Echo custom admin field into a is_single()

$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

Update siteurl and home in multisite subsites to https

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)