Undefined function wp_set_password

When your plugin loads, pluggable functions aren’t loaded yet, in fact a lot of stuff is not loaded yet, this what actions are for. Hook your function to an action, like plugins_loaded or init, when the WP environment is loaded and initialized: add_action( ‘init’, ‘wpa80246_init’ ); function wpa80246_init(){ wp_set_password( ‘newpass’, $user_id ); }

Rearranging Dashboard meta boxes with use of plugin/functions.php

add_meta_box has a the following placement parameters: $context ‘normal’, ‘advanced’, ‘side’ $priority ‘high’, ‘core’, ‘default’ ‘low’ For $context the difference between normal and advanced is that normal will be placed on the page before advanced. The $priority determines the hierarchy but is overridden when dragged by the user. You can disable the drag and drop … Read more

Timeout on Admin-Ajax?

There is always a timeout, be it TCP or the PHP execution time ( unless you configure your server in a weird way, PHP will kill long running tasks ). If you need to do a lot of work you should: Break it into smaller pieces Plugins like regen thumbnails retrieve a list of items … Read more

Plugin base URL

I think you are looking for plugin_dir_url: $url = plugin_dir_url(__FILE__); $imageurl = $url.’images/someimage.png’; EDIT: Sorry I misread the question… that is only an answer to the linked question. You could check the parent directory recursively until you find the right one: function base_plugin_dir($dirpath) { if (substr(dirname($dir),-7) == ‘plugins’) {return $dirpath;} else {$dirpath = base_plugin_dir($dirpath);} return … Read more

WP rest api v2 posts filter by ‘search’ & ‘category_name’ not working

The filter parameter was removed as part of WP 4.7, to get the results you expect you’ll need to change http://examples.com/wp-json/wp/v2/posts?filter[category_name]=uncategorize&per_page=30&order=asc&search=hello to http://examples.com/wp-json/wp/v2/posts?categories=1&per_page=30&order=asc&search=hello Make sure to change categories=0 to whatever uncategorised‘s tag_ID is. If you’d like to restore the Filter parameter, I would recommend this plugin: https://github.com/WP-API/rest-filter