Can i use one wp plugin inside other?

Yup, you certainly can. At bare minimum, just require the plugin’s main file inside your plugin file. You’ll just need to activate YOUR plugin, but you’ll still have function from the included plugin. require_once ‘/otherplugin/main-file.php’; If you want to make it more sophisticated, you could set up a composer.json file in your plugin, which could … Read more

Modify search form with plugin

Here’s an alternative way to only make the product post type searchable, from a plugin code: <?php /** Plugin Name: Product Search Only **/ add_filter( ‘register_post_type_args’, function( $args, $post_type ) { $args[‘exclude_from_search’] = true; if( ‘product’ === $post_type && (bool) $args[‘public’] ) $args[‘exclude_from_search’] = false; return $args; }, 999, 2 ); Here we modify the … Read more

Proper structure for first WP plugin?

More research at the WordPress Codex and related sites for current (2016/2017) solutions … the following tested and works fine … ` defined(‘ABSPATH’) or die(‘No direct file access allowed!’); // Modify post content function myplugin_filter_content($content) { return $content . ‘ Almost an error message but not quite. ‘; } add_filter(‘the_content’, ‘myplugin_filter_content’); function schema_TinyMCE_init($in) { $props=”@[id|class|style|title|itemscope|itemtype|itemprop|datetime|rel],div,dl,ul,dt,dd,li,span,a|rev|charset|href|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur]”; … Read more