Change order of custom submenu link in WP Admin?

Take a look at this function. function my_submenu_order($menu_ord) { global $submenu; // echo ‘<pre>’.print_r($submenu,true).'</pre>’; $arr = array(); $arr[] = $submenu[‘users.php’][15]; // Your Profile $arr[] = $submenu[‘users.php’][10]; // Add New $arr[] = $submenu[‘users.php’][5]; // All Users $submenu[‘users.php’] = $arr; return $menu_ord; } add_filter(‘custom_menu_order’, ‘my_submenu_order’); Add that to your functions.php. It changes the default order of the … Read more

How to check if a Customizer setting is set?

Adding an action will fire the function regardless, but you can add an if statement to see if the value has been set. This way the tag will not fire if the value is not set function chrome_theme_meta() { $chrome_theme = get_theme_mod( ‘chrome_theme’, ” ); if(!empty($chrome_theme){//test to see if a value is set echo ‘<meta … Read more

Loop stopped working

While <? was once a valid php opener, you should be using <?php. Try changing this line: <h2>Colour Chart</h2> <? to <h2>Colour Chart</h2> <?php That should allow the php to be read correctly.

WordPress member notification

PHP only runs when you request a page. When the request is over, everything is gone. It’s not like a Node application where the same program handles all the requests and variables can persist across pages just by defining them, so doing things with a $wp_session variable will only do things on that request. If … Read more

Problem changing from PHP 5.6 to PHP 7.2 [duplicate]

This can be tricky to help with without some more details. Sounds like PHP 7 has run into some compatibility errors. Seems that you need to look at line 87 of /homepages/36/d129703868/htdocs/mightyoak/bhd-wp/wp-content/themes/construct/lib/classes/menu-walker.php Is this the Construct Theme and are you running the latest version?

Display Data in Table from External Database in WP using Shortcodes

While it is VERY bad practice to have spaces in the object names, there are times where it may be out of your control. You can use the syntax of $object->{‘Property Name’}, like this: // add the shortcode [pontoon-table], tell WP which function to call add_shortcode( ‘pontoon-table’, ‘pontoon_table_shortcode’ ); // this function generates the shortcode … Read more