Getting WordPress fatal error when hitting WooCommerce API

So, after fiddling with this all week, i finally found the solution. In my original script, i asked for 99999 products with this line: $products = $woocommerce->get(‘products’, $parameters=[‘per_page’ => 99999]); I also had this function in functions.php in WP: function maximum_api_filter($query_params) { $query_params[‘per_page’][“maximum”]= 99999; return $query_params; } add_filter(‘rest_product_collection_params’, ‘maximum_api_filter’); The new changes i made to … Read more

Get /users/me details from WordPress backend

“a:1:{i:0;s:12:\”Earth\”;}” This is a PHP serialized value. If you pass it to unserialize you’ll get back the array you’re expecting. (And it looks like you’ve edited it because “Earth” is not 12 characters long: that should be s:5:”Earth”.) However I’m surprised that get_user_meta doesn’t already do this for you: it passes the value it’s fetched … Read more

call funcution when clicking submit

<?php if(array_key_exists(“button1′, $_POST)) { button1(); } function button1() { echo “This is Button1 that is selected”; } ?> <form method=”post”> <input type=”submit” name=”button1″ class=”button” value=”Button1″ /> </form> </head> </html> you call button click function this type you need more refrance follow this link

How do i post data to url with fields?

You have to build the array as the json array needs to be $args = array( ‘headers’ => array( ‘Content-Type’ => ‘application/json’, ‘Authorization’ => ‘Basic ‘.$apiKey ) ); $bdy = array( ‘fields’=> array( ‘project’ => array( ‘key’ =>’LD’ ), ‘summary’=> ‘CODING WORKS’, ‘description’ => ‘Creating of an issue using project keys and issue type names … Read more

how to create JSON array [] for REST response?

Just use another array() inside user array() $response = array(); $response[] = array( ‘version’ => ‘1.0’, ‘user’ => array( array( ‘first_name’ => ‘Razon’, ‘last_name’ => ‘komar pal’, ’email’ => ‘[email protected]’, ‘id’ => 10, ) ), ); return rest_ensure_response($response); It will output like: [ { “version”: “1.0”, “user”: [ { “first_name”: “Razon”, “last_name”: “komar pal”, “email”: … Read more

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