How can a plugin create a page/form in the front end?
See How do you create a “virtual” page in WordPress for the solution. This should work for your case as well.
See How do you create a “virtual” page in WordPress for the solution. This should work for your case as well.
That’s the total number of downloads. It includes direct downloads in the Repository and installs/updates done in the dashboard. Quotes from Otto comments in this 2010 article about the stats charts in every plugin’s page. […] the download count includes direct downloads as well […] There is no “raw count” anywhere on that version number … Read more
Symbolic links are … risky in WordPress. It is easier to use a separate domain for plugins per wp-config.php: define( ‘WP_PLUGIN_DIR’, ‘/local/path/to/plugin/directory’ ); define( ‘WP_PLUGIN_URL’, ‘http://plugins.dev’); See Strategy On Building Plugin Using Eclipse as an example for IDE configuration with such a setup.
My best guess would be: if ( ! is_file( $dir = WPMU_PLUGIN_DIR . ‘/pluginb/pluginb.php’ ) ) { if ( ! is_file( $dir = WP_PLUGIN_DIR . ‘/pluginb/pluginb.php’ ) ) $dir = null; } return $dir; However, the danger here is still the assumption of the plugin’s “basename” – a well written plugin will still function even … Read more
So what’s the best practice here? I would say a combination of letting the theme handle it and providing a default with your plugin. You can use the single_template filter to switch out the template. In your callback, see if the theme provided a template for the post type, if it did, do nothing. <?php … Read more
You can execute arbitrary SQL statements with wpdb::query(), including Data Definition Statements, e.g. function create_index () { global $wpdb ; $sql = “CREATE INDEX my_index ON {$wpdb->prefix}my_table (my_column)” ; $wpdb->query ($sql) ; return ; } Note: Because $wpdb->query() can execute arbitrary SQL, if the statement you pass to it contains ANY user input, then you … Read more
No, it is not possible to create third level menu in admin panel. If you look at the definition of add_submenu_page, you need to mention the parent slug name. For eg: add_menu_page ( ‘Test Menu’, ‘Test Menu’, ‘read’, ‘testmainmenu’, ”, ” ); add_submenu_page ( ‘testmainmenu’, ‘Test Menu’, ‘Child1’, ‘read’, ‘child1’, ”); The first parameter of … Read more
We start by adding the custom TinyMCE Button: function add_mce_button_custom_em() { // check user permissions if ( !current_user_can( ‘edit_posts’ ) && !current_user_can( ‘edit_pages’ ) ) { return; } // check if WYSIWYG is enabled if ( ‘true’ == get_user_option( ‘rich_editing’ ) ) { add_filter( ‘mce_external_plugins’, ‘add_tinymce_plugin_custom_em’ ); add_filter( ‘mce_buttons’, ‘register_mce_button_custom_em’ ); } } add_action(‘admin_head’, ‘add_mce_button_custom_em’); … Read more
It depends on how you are going to use the stored data. If you want to run complex queries against the values, use a custom table with indexes optimized for those queries. If you will always just fetch all the values for a given object, create a non-public custom post type, and store the data … Read more
I may be late to this party, but to stop plugin activation and have WordPress show an error message where the admin notices go, I simply output an error message and terminate execution. This has the added advantage of playing nice with wp-cli: Example: class testPlugin() { … static function activate() { //[do some stuff … Read more