Warning: Use of undefined constant list_all – assumed ‘list_all’ (this will throw an Error in a future version of PHP)

There is a bug in this code: add_menu_page(‘Simple Table Manager – List’, ‘Simple Table Manager’, ‘manage_options’, $this->slug[‘list’], array($this, list_all )); The part array($this, list_all ) is a function callback, but there should be name of a function passed as string as second item in the array. So it should be: array($this, ‘list_all’ ) PS. It … 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