How to get variables from fucntion.php to my plugin files

There is three way to use function.php file variable into plugin file. Using global. Make sure you globalize it first. global $my_variable; echo $my_variable; I recommend is using WordPress built-in filter mechanism add_filter. You add the filter in your functions.php file and apply it where needed. In functions.php: add_filter( ‘my_variable’, ‘return_my_variable’ ); function return_my_variable( $arg … Read more

How to add settings subpage from a plugin to a settings page created in theme?

This is just a typo Wrong //wvdh-startpoint add_submenu_page( ‘wvdh-startpoint’, ‘page-from-plugin’, ‘menu-from-plugin’, ‘manage_options’, ‘plugin-slug’, ‘wvdh_settings_page’ ); Correct //wdvh-startpoint add_submenu_page( ‘wdvh-startpoint’, ‘page-from-plugin’, ‘menu-from-plugin’, ‘manage_options’, ‘plugin-slug’, ‘wvdh_settings_page’ );

Minimum PHP Required for WordPress

WordPress will work with PHP 5.2.4+ and MySQL 5.0+ but the WordPress docs suggest sites run on 5.6 or greater (April 6, 2016). For personal themes/plugins I would suggest supporting at least php 5.5, but for plugins/themes you are trying to sell you may want to go down to 5.3. While PHP versions 5.5 is … Read more

Where does WordPress register default scripts like jQuery?

WordPress registers jQuery in the wp_default_scripts() function, which is found in wp-includes/script-loader.php. // jQuery $scripts->add( ‘jquery’, false, array( ‘jquery-core’, ‘jquery-migrate’ ), ‘1.11.3’ ); $scripts->add( ‘jquery-core’, ‘/wp-includes/js/jquery/jquery.js’, array(), ‘1.11.3’ ); $scripts->add( ‘jquery-migrate’, “/wp-includes/js/jquery/jquery-migrate$suffix.js”, array(), ‘1.2.1’ );

Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]

There seems to be two separate question here: Should one do this? Not under most circumstances. Modifying third party extensions de-facto forks it with all implications of future maintenance and/or merging upstream (from original) changes. Without long term commitment it’s just not practical and promptly falls apart, like in the cases you witnessed. Should one … Read more