Articles of database

Where are WP_Errors Saved

Hi it seems to be trivial question but it is the one I can not find an answer of. I am tweaking a wp site developed by somebody. They have used custom errors and they are getting errors by get_error_code(); but there is no place I could find where they have actually saved the errors. […]

I cannot find the difference between these wp_capabilities values in wp_usermeta

a:1:{s:13:”administrator”;s:1;} a:1:{s:13:”administrator”;s:1:”1″;} a:1:{s:13:”administrator”;b:1;} I am debugging some login issues and answers online seem to use variations of these. Please explain the characters following the semicolon inside the brackets { ;____} I find these are advised for the phpMyAdmin wp_usersmeta table with meta_key for wp_capabilities.

Bulk Update of Custom Post Type Post Status through SQL

The following code updates the post status of standard wordpress posts to ‘Archived’. UPDATE wp_posts SET post_status = ‘Archived’ WHERE post_status != ‘static’; How can I make this only affect custom post types with the slug of ‘cpt_operator’. I know I can do this from Wp-Admin but with over 2,500 posts its a huge task.

Get total number of comment of the posts written by an author

I have put this code on author.php page <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); //gets the number of comment(s) on a post $comments_number = get_comments_number(); //adds all the comment counts up $numbercomment += $comments_number; ?> <?php endwhile; ?> <span>A total of <?php echo $numbercomment; ?> comments have been made […]

Location of WP default mySQL tables creation file?

I’m looking for the PHP file that defines the creation of the default tables when you initially install WordPress. Tables listed under the Database Description: wp_commentmeta wp_comments wp_links wp_options wp_postmeta wp_posts wp_term_relationships wp_term_taxonomy wp_termmeta wp_terms wp_usermeta wp_users I’ve gotten down to wp-db.php where I was able to find several vars that have the default table […]

Valid SQL query not returning results

I am trying to retrieve some basic information from the WordPress database for a theme. However, when the query runs it returns no data. If I run the query on Phpmyadmin, it works fine. Note, wp_places_locator is a table used by a third party plugin. function get_info($postid) { global $wpdb; $info = $wpdb->get_results($wpdb->prepare(“SELECT post_id, address, […]

Custom search query by category id

Soo I just made a simple search page. Its working! But i wanted to filter the results. The query that i wanted to make its like, it will search by the name of the articles and filter it, soo it only appears the articles from the category X (By ID). This is my form: <form […]

WordPress database products structure

I am writing an external program on c++ which supposed to import products to WordPress database (it should directly connect to remote MySQL server and just execute some SQL queries to create a new product). I have all the products’ properties and remote database access, but I can’t completely understand how does actually WordPress serves […]

Where do plugin variables live in the db?

I’m no developer, rather a designer. But for my wife, I’ll be all things (this is for her free e-comm, erp, and crm solution) So, i’m connecting dolibarr to woo com. i need to double check the entry of the highlighted field. that sucker needs to exist in the database somewhere…but i can’t find it. […]

Entity to store contact form entries?

Lets say I develop minimal contact form plugin. The plugin save contact entries in the website. I think custom post type is not best way to store contact entries since post type is specifically created for front-facing contents. Because of this curiosity, I installed a form builder (FormCraft) and make one entry by filling the […]