Hi Mikko;
I create custom plugin for adding posts, tags and custom fields to WordPress. I tried trigger to Relevanssi but my previous methods did not work. Your methot is works!
Before; I got an error of relevanssi_insert_edit() function was not found. This error is due to plugin ordering. But I solved this with a plugin order function.
function this_plugin_last() {
$wp_path_to_this_file = preg_replace('/(.*)plugins\/(.*)$/', WP_PLUGIN_DIR."/$2", __FILE__);
$this_plugin = plugin_basename(trim($wp_path_to_this_file));
$active_plugins = get_option('active_plugins');
$this_plugin_key = array_search($this_plugin, $active_plugins);
array_splice($active_plugins, $this_plugin_key, 1);
array_push($active_plugins, $this_plugin);
update_option('active_plugins', $active_plugins);
}
add_action("activated_plugin", "this_plugin_last");
https://gist.github.com/bappi-d-great/26808240df88dd1fc3fe
The “relevanssi_insert_edit” function works perfectly now
if (function_exists('relevanssi_insert_edit')) {
relevanssi_insert_edit($new_ID);
}
Thank you for your detailed reply. Your plug-in works very well. Please continue to develop and supporting.
Have a good weekend.
-
This reply was modified 7 years, 1 month ago by CeeWP.