Where to store PHP files created by plugin / themes
The appropriate place IMHO would be a custom folder that you create inside the wp-content directory Read this before creating files: http://ottopress.com/2011/tutorial-using-the-wp_filesystem/
The appropriate place IMHO would be a custom folder that you create inside the wp-content directory Read this before creating files: http://ottopress.com/2011/tutorial-using-the-wp_filesystem/
First of all, WordPress registers jQuery UI via wp_default_scripts(). Dependencies are already set, so you only need to enqueue the script you really need (and not the core). Since you’re not changing version number or anything, it is ok to only use the handle. // no need to enqueue -core, because dependancies are set wp_enqueue_script( … Read more
You can use __DIR__ constant. Since the file is either inside plugin or theme folder, which are always located inside wp-content folder.. You can simply get the path of the file and trim everything starting from wp-content from it: $path = preg_replace(‘/wp-content.*$/’,”,__DIR__); If you need to make sure the wp is not inside some wp-content … Read more
I’m going to post a partial answer to start the discussion in the hope of getting some helpful comments to fill in the blanks or alternative answers… Step 1: Install and Set Up boot2docker Docker only runs on Linux. So in order to use Docker on our Mac, we need to install boot2docker, which will … Read more
there are several guides in the Codex that can help, Set up your plugin for submission Submit your plugin Keep it up to date I also think it’s a great idea to “fix” older useful plugins 🙂 Steps: http://wordpress.org/extend/plugins/about/ Submit: http://wordpress.org/extend/plugins/add/ How to Use Subversion: http://wordpress.org/extend/plugins/about/svn/ Promotion and additional info: http://codex.wordpress.org/Plugin_Submission_and_Promotion Using subversion depends on … Read more
Maybe a little late but I stumbled on this when I was having issues figuring it out so thought I would supply what I found out for future people. I’ve found the basic principles are to have a hidden input named action and it’s value being a custom set identifier. For example <input name=”action” type=”hidden” … Read more
Use get_posts() and the parameter name which is the slug: $page = get_posts([ ‘name’ => ‘your-slug’ ]); if ( $page ) { echo $page[0]->post_content; } Be aware that the post type in get_posts() defaults to ‘post’. If you want a page use … $page = get_posts([ ‘name’ => ‘your-slug’, ‘post_type’ => ‘page’ ]); If you … Read more
1. Does this have effect on WP performance in a visible way ? IF it would have a real affect for some small files, then it would have an affect that has an impact lower than WP: PHP and server performance. Does it really have an affect? Not really. But you can still simply start … Read more
You can’t pass an argument to the callback function. add_menu_page() adds it as an action handler, and admin.php fires the action, without any arguments. I see two simple solutions to this problem. One is to store all filename in an array in your class, indexed by hook name. Then you can use this to look … Read more
try replacing : register_widget(‘States_Widget’); with: add_action(‘widgets_init’, ‘register_states_widget’); function register_states_widget() { register_widget(‘States_Widget’); }