Problem with Settings API: changes are not saved after submit

You need to register the proper settings fields in your PPAdminOptions() and also point the form action to options.php: function PPAdminOptions() { if ( !current_user_can( ‘manage_options’ ) ) { wp_die( __( ‘You do not have sufficient permissions to access this page.’ ) ); } ?> <div class=”wrap”> <h1><?php echo get_admin_page_title(); ?></h1> <form method=”post” action=”options.php”> <?php … Read more

Validate rest-api call on create

As I said in the comments, since it’s a custom endpoint, you could just cancel the post creation via the main callback, i.e. something like so: ‘callback’ => function () { if ( some condition ) { // create the post } else { // return existing post or something else } } And here’s … Read more

WordPress stats API key

This is why: http://plugins.trac.wordpress.org/browser/stats/tags/1.7.2/stats.php#L685 The deactivation hook deletes your database information. I’m guessing you’re manually deactivating the plugin, updating, and then re-activating? If so, that runs the deactivation hook. Fortunately, that’s not from the latest version. This is: http://plugins.trac.wordpress.org/browser/stats/tags/1.7.3/stats.php#L686 So that shouldn’t happen anymore. By the way, you shouldn’t think that this means you were … Read more

Use WP admin AJAX url to hide API key

I would break this problem in to 2 parts. First, you could sent an Ajax request to your server, sending only the dataString variable. Then, you can use either cURL or wp_remote_get() on the server to access the real API. This could be the only solution, if you want to avoid playing hide and seek … Read more

How to send messages when a customer is registered

If you’re talking about WordPress user registration, you want to start by reading about the User Register hook: https://codex.wordpress.org/Plugin_API/Action_Reference/user_register Then your code would be something like this which will automatically fire each time a user registers on the site: add_action(‘user_register’,’send_sms’); function send_sms($user_id){ // Code for your SMS API Here } The code would go in … Read more

How to query WordPress from another application?

different solutions use the rss or atom-feed (each is xml) and parse it; has always fast and sure the post and data inside; easy to use with different langugage, all frameworks has implement for parse xml. use the xmlrpc interface; but is optional in WP and you must read the documentation for the API scan … Read more

Easiest way to call an External rest API?

Mark is right, without knowing more, this is a hard question to answer. This is a general guide though (not written by me) that I’ve used for my projects in the past. https://yoast.com/wordpress-http-api/ It should get you started and then if you have other questions, please let us know.

WordPress api call using wp-ajax returns error 400

I figured this out after a night sleep. Sometimes our brains function like that. The problem was actually my call here, It should’ve been “add_foo” not “_add_foo” data: { // the value of data.action is the part AFTER ‘wp_ajax_’ in // the add_action (‘wp_ajax_xxx’, ‘yyy’) in the PHP above action: ‘_add_foo’ // ANY other properties … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)