How to link to images in my plugin regardless of the plugin folder’s name
I am not sure about this specific example but in general plugins_url() is fitting function for this. Example from Codex: plugins_url(‘/images/wordpress.png’, __FILE__);
I am not sure about this specific example but in general plugins_url() is fitting function for this. Example from Codex: plugins_url(‘/images/wordpress.png’, __FILE__);
You can’t redirect to another page, because WordPress has already rendered admin header and sidebar templates. If you really wish to redirect users to another page, you need to do it earlier, before header and sidebar are rendered. You can use action of following structure to redirect to another page: load-{parent_page_slug}_page_{plugin_subpage_slug} The full snippet: define( … Read more
You can accomplish this by setting a class on the body and removing it with JS when the page is loaded. This is just a basic example but it’ll work out of the box. // Add specific CSS class by filter add_filter( ‘body_class’, ‘my_class_names’ ); function my_class_names( $classes ) { // add ‘class-name’ to the … Read more
Using get_page_by_title() along the line of below exemplary code should work: if ( get_page_by_title( $page_title, $output, $post_type ) == NULL ) { $exists = false; } else { $exists = true; } Explanation: $page_title is obviously what you are looking for; $output can be OBJECT, ARRAY_N or ARRAY – Default: OBJECT; $post_type can be specified, … Read more
I don’t think that you should touch these options. WordPress core already handles this, whether by removing the references to your plugin when it is deleted (as in delete_plugins()), or by being coded in such a way that it can ignore the reference to the removed plugin. Actually, none of these three options will last … Read more
There is a solution for this. Manually create the long name attribute in “Product Attributes” page, and use a short slug name here. In the product import section there is no “attribute slug” in the Column Headers(Or maybe there is one but not used by WooCommerce by default). Like so Then you can import from … Read more
Remove the filter from the the_content and run it after the shortcode are processed. Try: remove_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘wpautop’ , 12); Usually shortcodes are processed after wpautop is applied to the content. See http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/shortcodes.php#L296
Err… There’s plenty of filters on the menu system. The ‘wp_nav_menu’ filter is called on the output of the wp_nav_menu() function call. So if you need to modify the menu output, you can use that. The ‘wp_nav_menu_items’ filter is called on the resulting array of items (basically all the LI items). If you need to … Read more
By default, the output returned by your endpoint/callback will always be sent as a JSON-encoded string (and the Content-Type header would also be/contain application/json), so you can’t use that callback for sending an XML feed. However, you can use the rest_pre_serve_request hook if you want your REST API route to serve a different type of … Read more
It looks like Gravity Forms can do this. I just did a quick search on the support forums and found this, an answer to someone asking almost exactly the same question as you: Gravity Forms can be used to create custom post types as well as custom taxonomies, however it doesn’t do so out of … Read more