Fatal error: Uncaught Error: Call to undefined function get_option()

Instead of doing this, simply write your own function inside the verifyapi.php and then include it in your plugin’s main file, by using this: require_once(‘verifyapi.php’); This way, you have access to WordPress’s function inside your verifyapi.php file. Now, inside your verifyapi.php file, create an Ajax handler (however I would recommend using a REST endpoint) : … Read more

Plugin directory says that my plugin it’s not availabe in Spanish, but it is

To be able to approve your own plugin translations you have to post in the Polyglots site: https://make.wordpress.org/polyglots/ a message like this: “Hello, I’m the author of the {insert plugin name and a link} plugin. Could you allow me to approve translations in my native language (es_ES), please?” And select “Editor Request” in the “Post … Read more

How can I replace content in the WP Admin area before an admin page is rendered?

There’s no filter for filtering all of the HTML output in the admin. The closest thing is the gettext filter: function wpse_275812_filter_text( $translated_text, $text, $domain ) { $translate_text = str_ireplace( ‘foo’, ‘bar’, $translated_text ); return $translated_text; } add_filter( ‘gettext’, ‘wpse_275812_filter_text’ ); This filters any text output by the internationalization functions (__(), _e(), etc.). So it … Read more

WordPress pre_get_posts with combined results of two queries (OR)

See WP_Query as reference for the post query filters. You can filter posts by their authors with the ‘author’ query var as you filter posts by their taxonomy with ‘tax_query’ query var. Then, conditionally set the ‘tax_query’ query var depending on the user’s company meta field. If it’s empty, set the ‘author’ query var instead. … Read more

parse content from wikipedia article replacing search term with the title of article

You can’t and shouldn’t echo something into a function’s arguments. The single_post_title() function will echo the title by default. You should either set the second parameter to false, or use another function: echo getDescription( single_post_title( ”, false ) ); WordPress also offers the get_the_title() function that returns the single post’s title which you can use … Read more