by Garth | Jul 24, 2018 | PHP, Snippets, Wordpress
Here’s the Stackoverflow link Here’s the improved answer //The Function function in_array_r($needle, $haystack, $strict = false) { foreach ($haystack as $item) { if (($strict ? $item === $needle : $item == $needle) || (is_array($item) &&...
by Garth | Jul 23, 2018 | PHP, Snippets, Wordpress
add_action( ‘admin_head’, ‘remove_my_meta_boxen’ ); function remove_my_meta_boxen() { remove_meta_box( ‘postimagediv’, ‘countries’, ‘side’ ); add_meta_box(‘postimagediv’, __(‘Country...
by Garth | Jul 22, 2018 | PHP, Plugins, Wordpress
Meta Box – WordPress Custom Fields Framework The code below relates to the meta box plugin. And the code below relates to 2 custom post types. Players and Coaches. And then adding meta fields to those custom post types. // Custom Post 1 register_post_type(...
by Garth | Jul 16, 2018 | Debugging, PHP, Snippets
ini_set(‘display_errors’, 1); ini_set(‘display_startup_errors’, 1); error_reporting(E_ALL);
by Garth | Jul 13, 2018 | CSS, PHP, Wordpress
// Styles and Scripts add_action(‘admin_head’, ‘my_custom_styles_and_scripts’); function my_custom_styles_and_scripts() { echo ‘ <script...
by Garth | Jul 8, 2018 | PHP, Snippets, Woocommerce, Wordpress
$woocommerce->cart->empty_cart();