How to request admin-ajax.php correctly when wordpress URL and site URL are different?

admin_url() should be used. However for some websites this request gives error 404 in front-end admin_url(‘admin-ajax.php’) should point to an actual file (admin-ajax.php), as such WordPress won’t pass it through index.php, and so it shouldn’t lead to the theme’s 404 page. (Unless the file has been deleted). … unless you have a .htaccess file which … Read more

How to add filter for wordpress plugin?

You are almost close. add_filter( ‘some_custom_filter’, array( $this, ‘filter_suppress_the_content’ ), 10, 3 ); // the above line states that, the method `filter_suppress_the_content` should have three arguments, where you have used nothing. public function filter_suppress_the_content() { return true; } // comparing your code, this method should have one argument The solution: public function setup_filters() { add_filter( … Read more

Post deleted in trash [closed]

Once a post is moved to the trash and deleted, it’s gone from the database. The only way to recover it is from an earlier database backup. Do you have a backup? Does your webhost have a backup?

How to find the Registration page

This is a buddypress page, linked with the page ID 4275. The body class of your delivered HTML is: <body class=”registration register buddypress page page-id-4275 page-template-default admin-bar no-customize-support no-js”> To edit this page itself, go to http://hoteliersnetworkme.com/wp-admin/post.php?post=4275&action=edit BuddyPress filters the content of this page and adds a registration form. To modify the registration form itself, … Read more

Can i use init hook for API purpose?

If you want a more user-friendly URL structure, you could add a rewrite endpoint. This will add the rules for and intercept requests to /my-api/: function wpd_add_api_endpoint() { add_rewrite_endpoint( ‘my-api’, EP_ROOT ); } add_action( ‘init’, ‘wpd_add_api_endpoint’ ); function wpd_api_request( $request ){ if( isset( $request->query_vars[‘my-api’] ) ){ // $request->query_vars[‘my-api’] is a string containing everything after your … Read more

How to rename WP plugin?

You can change the name by going to the main php file for the plugin. The name and description should be at the top. If you are unsure of which file is the main php file for the plugin just install it and go to the plugin editor. WP will display that file. Note. If … Read more

What makes it possible for a plugin to not able to delete?

While I don’t know exactly what code is responsible, your last comment– ” It has this uninstall.php inside that plugin’s plugin root directory”– gives me a pretty good idea of what is happening. If the plugin can not be written without running code within the plugin, then the plugin should create a file named ‘uninstall.php’ … Read more