Overriding current theme files via plugin

Template logic is primarily controlled by template-loader.php. The part you are interested in would be get_404_template(), which passes on to generic get_query_template() with number of hooks to override the logic and result. {$type}_template (so 404_template) filter would probably do it.

strange shortcode error: does shortcodes requires any dependency?

Problem 1 It doesn’t work because you’re using new_weber but you’re registering news_burner, and they aren’t the same So instead use: [news_burner] You only need a closing shortcode if it’s containing content which that plugin does not. Problem 2 Shortcodes don’t work in text widgets out of the box, you can add that functionality via … Read more

Function call in wordpress short code handler fails

You’re returning X(), but your X() function appears to be within a class. Presumably the same class as handleShortcode(). So you need to call it the normal way you call functions within a class: public function handleShortcode($atts) { return $this->X(); } private function X() { return ‘Hi world’; } If you’re not in a class … Read more

Correct Plugin File Path

https://developer.wordpress.org/reference/functions/plugin_dir_path/ It looks like this function adds a trailing slash, so starting your string with a slash is not required try; require_once(plugin_dir_path( __FILE__ ) . ‘assets/MCAPI.class.php’);

Submit plugin for review

Most likely, your header is not complete, or not up to the standards. It can also be a problem with the readme.txt file that also requires very specific structure. Start by reading the guidelines, and check some other plugins to see how the plugin should be organized correctly: Detailed Plugin Guidelines.

Plugin to reformat the post automatically after submitting

You should use the transition_post_status to filter the content after submitting the post. Try the below code in the functions.php in your theme: add_action( ‘transition_post_status’, ‘_new_post’, 10, 3 ); function _new_post( $new_status, $old_status, $post ) { if ( ‘publish’ !== $new_status or ‘publish’ === $old_status ) { return; } if ( ‘post’ !== $post->post_type ) … Read more

Api external with wordpress

WordPress itself can communicate with external API’s through wp_remote_get and wp_remote_post. See the codex. In your case, you could create a page template called page-search.php (keep in mind that search.php is reserved for the internal WordPress search functionality, so you would define it as a template, and select it when creating the page), and run … Read more