Deactivate sub-plugin when parent-plugin is deactivated
Deactivate sub-plugin when parent-plugin is deactivated
Deactivate sub-plugin when parent-plugin is deactivated
Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?
This will find all terms in custom taxonomy underkategorier and then will show terms with post from chosen category. $taxonomies = get_taxonomies(array(‘name’=>’underkategorier’),’object’); foreach($taxonomies as $taxonomy) { $terms = get_terms( $taxonomy->name, ‘orderby=count&hide_empty=0’ ); foreach($terms as $term) { $wpq = array (‘taxonomy’=>’underkategorier’,’term’=>$term->slug, “cat”=>10); $myquery = new WP_Query ($wpq); $article_count = $myquery->post_count; echo $term->name.’ ‘.$article_count; //with empty ones … Read more
WordPress Thickbox Navigation Issue in Gallery
Eventually came to a solution in case anyone needs it: function mb_get_user_meta_values( $mb_user_meta_key ) { if( empty($mb_user_meta_key) ) return; $mb_get_users = get_users( array( ‘meta_key’ => $mb_user_meta_key ) ); $mb_user_meta_values = array(); foreach( $mb_get_users as $mb_user ) { $mb_user_meta_values[] = get_user_meta( $mb_user->ID, $mb_user_meta_key, true ); } $mb_user_meta_values = array_unique( $mb_user_meta_values ); return $mb_user_meta_values; } Then I … Read more
you can apply a filter on products by passing URL query www.mysite.com/shop/?min_price=0&max_price=5000
First of all, you should never build SQL queries like you do – concatenating SQL with raw variables is insecure and it causes SQL Injection vulnerabilities. You should always prepare all queries. As for the main part of question… You use AND operator in your query, so it will retrieve only rows, that will satisfy … Read more
You can fetch data using wp_remote_get(). //API URL $url=”your api url”; // API RESPONSE $response = wp_remote_get($url, “your headers goes here / use array to set multiple headers.”); you can then access content from $response. $response[‘body’]; // will give you content. wrap it with your own function name and add this code in your functions.php … Read more
the_content filter can be used to filter the content after it is retrieved from the database and before it is printed to the screen. The Core filters on the_content are: add_filter( ‘the_content’, ‘wptexturize’ ); add_filter( ‘the_content’, ‘convert_smilies’ ); add_filter( ‘the_content’, ‘convert_chars’ ); add_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘shortcode_unautop’ ); add_filter( ‘the_content’, ‘prepend_attachment’ ); Reference … Read more
Yes, there are tons of plugins to realize this. In my opinion, the most reliable, streamlined and bugfree plugin is “members” by Justin Tadlock. As I’ve said, there are hundrets if not thousands of plugins which can do this. Just browse the plugin directory. On the other hand, building some custom redirects is not that … Read more