Tag Info

New answers tagged

2

You have the following methods of the $wpdb object: $wpdb->flush() that contains a call to mysqli_free_result() or mysql_free_result() if not supported. $wpdb->check_connection() that contains a call to mysqli_ping() or mysql_ping() if not supported. You can of course use all your PHP functions in WordPress. Here's an example based on the \wpdb ...


0

I realized that all you have to do is find where the database is returned (in my case it is wp-init.php) and change the prefix to reflect the shared database: $wpdb->prefix="wp_";


2

I would use a custom query like this: $amsterdamstore_args = array( 'post_type' => 'store', // This is your custom post type 'tax_query' => array( array( 'taxonomy' => 'city', // This is your custom taxonomy 'terms' => 'Amsterdam', // The term you search for 'field' => 'name', // Check against the term's ...


1

You need a custom query and loop here, at least that's how I do it. $args = array( 'post_type' =>'store', 'taxonomy' => 'city', 'term' => 'your list here' 'posts_per_page' => 5 ); $loop = new WP_Query($args); if($loop->have_posts()): while($loop->have_posts()): do stuff here endwhile; endif; You will probably want to ...


1

What the author of the article posted, as I read it, is suggesting you do is something like this: $cats = array(1,2,3,4); $q = new WP_Query( array( 'category__not_in' => $cats ) ); var_dump($q->request); You should see the complex default query in that dump. $ids = array_unique(get_objects_in_term($cats,'category')); var_dump($ids); Now ...


1

Comment type is similar to post type, because it allow to query only a specific type of comments, just like post type allow to query one or more post types. And just like core post types (page, post) there are core comment type as well: 'comment', 'pingback', 'trackback'. A difference between the two is that, by default, WP_Query do not fetch post types ...


0

Use PHP and the WordPress API. Place the following in copy-options.php and FTP it to wp-content/plugins, then activate it from the main site: <?php /** * Plugin Name: Copy Options * Plugin URI: http://wordpress.stackexchange.com/q/186092/1685 * Description: Copy options from site 2 to site 1. * Version: 0.1 * Author: TheDeadMedic * ...


0

It is possible to upgrade/update the database for each child site individually by visiting: https://rootsite/subsite/wp-admin/upgrade.php See also related core trac ticket, Database is not upgraded in multisite if loopback is disabled


0

I had something similar, entries of some post types didnt show. If your posts have the same IDs between dev/live environment, get the edit URL and replace the ID to see if it loads. Like : http://yoursite.com/wp-admin/post.php?post=23&action=edit Replace the ID (here '23') by the ID of the post/page/anythingelse you cannot see in live. If this ...


0

Sure, When you create categories,WordPress inserts detail in two tables WP_terms and WP_term_taxonomy .So when you delete category all entries does deleted. if you assign any post of that category.all post are automatically assign **uncategory**


1

Yes, the categories are stored in wp_terms table which contains the term_id, name and slug. Deleting the category in admin panel removes the three values along with it.


0

Create an iframe in your post content, and set its source as the google spreadsheet! You'll probably want to create a shortcode for iframes as they're stripped out of post content automatically, but there are questions asking how to do that on this site


2

The warning is regarding the following part of your code: __( ). In WP __ is actually a function for translation purposes. From a short look in the manual, we can see that the __() function usage is: <?php $translated_text = __( $text, $domain ); ?> And that the $text parameter is required. $text (string) (required) Text to translate. ...


1

Lead dev of Redux here. You can use one of our filters to match your needs: "redux/validate/{$this->args['opt_name']}/defaults" - Only on resetting defaults "redux/validate/{$this->args['opt_name']}/defaults_section" - Only on resetting one section "redux/options/{$this->args['opt_name']}/import" - Only on import ...


0

If you have to do this with php then you are going to want to use the WP_Http class. Specifically, you'll probably want to use wp_remote_post(). Something like this should get you started. function pushData($data){ //data is an associative array of the things you want to send $url = "https://yourhost.com/your_catch_script.php"; return ...



Top 50 recent answers are included