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

WordPress plugin require_once unexpected

This is a long shot but is there any possibility your text editor is encoding the file in UTF-8 with BOM? Try to save / encode the file in UTF-8 without BOM and see if the issue is gone. As for your plugin header, while it doesn’t totally follow the recommended format your header should … Read more

I would like to remove date display on photo preview

There are two possible solutions: CSS edit and File edit. CSS edit(Not the best solution, but works) .post-blocks .block-info span { display: none; } It is not possible for us to write the file edit code since we don’t have access to your admin panel. Install WhatTheFile plugin to find out the template that renders … Read more

Approve users posts before publish

// Add the content to $post as an array $post = array( ‘post_title’ => $title, ‘post_content’ => $description, ‘post_category’ => $_POST[‘cat’], // Usable for custom taxonomies too ‘tags_input’ => $tags, ‘post_status’ => ‘draft’, // Choose: publish, preview, future, etc. ‘post_type’ => $_POST[‘post_type’] // Use a custom post type if you want to ); wp_insert_post($post); // … Read more