How to send json data to jquery

You could use one of these. It would give you json data. $data = json_encode( array(‘status’ => 200, ‘message’ => ‘success’); $result = wp_send_json_success( array( ‘photo_id’ => $photo_id_encode,’upload_msg’ => ‘Success’ ) );

How to pull data from a table using wpdb?

First, you want to use the global $wpdb variable. global $wbdp; Then set up your query. Make it a separate variable so you can output it and check for syntax errors. $my_query = $wpdb->prepare( /* SQL query here */ ); Then execute the query. $results = $wpdb->get_results( $my_query );

Multiple level category drop-down three levels is not working

Already was resolve my problem and the cause is because the component was created dinamically, the solution is use .on(“change”, instead .change(function(). I share the code of Ján Bočínec with the modification to use three dropdownlist or more. //Parent child con ajax function parent_child_cat_select() { ?> <script type=”text/javascript”> /* <![CDATA[ */ jQuery(document).ready(function() { //segundo drop … Read more

$ not defined using jQuery in WordPress

You can wrap your javascript inside a self-invoking function, then pass jQuery as an argument to it, using $ as the local variable name. For example: (function($) { $(document).ready(function(){ $(“ul.vimeo_desc_feed li a”).click(function(){ alert($(this).attr(‘href’)); return false; }) }); }(jQuery)); should work as intended. If I remember correctly the WP-supplied version of jQuery (the one you get … Read more

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