Maxaud
Forum Replies Created
-
Forum: Plugins
In reply to: [Mobile CSS] Mobile-Detect Version 2.6Just wanted to let you know that the latest version uses the latest version of Mobile Detect.
Forum: Plugins
In reply to: [WP Mobile Detect] can't activateput an if statement in front and after the class definition.
if ( !class_exists( 'Mobile_Detect' ) ) { class Mobile_Detect { ...original class code.... } }I’m the author of the “Mobile CSS” plugin here:
http://wordpress.org/plugins/mobile-css/It uses the same class but correctly checks to see if it’s already defined.
Forum: Plugins
In reply to: [Mobile CSS] fatal errorThis is stating that the plugin “Mobile Detect” is declaring the same class. You can remove that plugin or I can make some changes to determine if that plugin is active and not load my version of that class.
My plugin first checks to see if the class exists before loading it again, this is the correct way to do it and I suggest the “Mobile Detect” plugin author does the same.
Forum: Fixing WordPress
In reply to: WordPress dropping sessions after updating to 3.6Deactivated all plugins.
Changed to default theme.
Tried a fresh copy of WordPress manually uploaded via FTP.
Tried setting up a new Multisite site.
Tried changing session hashes.Forum: Fixing WordPress
In reply to: WordPress dropping sessions after updating to 3.6Yes I have. First place I went.
Forum: Plugins
In reply to: [JSON API] Blank pages for all custom API calls after updateI’ve placed my code in a plugin in the /wp-content/mu-plugins/ directory so it doesn’t get overwritten and loads just like the functions.php file from a theme.
It’s weird because the plugin recognizes the controller in the backend but the API calls are blank and I don’t see any error codes either.
Forum: Plugins
In reply to: [JSON API] Place for custom controller that is safe from updates?No problem!
Forum: Plugins
In reply to: [JSON API] Place for custom controller that is safe from updates?You can view the code I used here for adding a custom external controller:
http://wordpress.org/support/topic/blank-pages-for-all-custom-api-calls-after-update?replies=3These aren’t working in the most recent version but gives you an idea as to what actions and filters to hook in to for changing the controller location.
Forum: Fixing WordPress
In reply to: tax_query not working, anything change in latest version?I managed to filter the code by adding some where and join clauses.
New code:
<?php global $pf_override; class PF_override { public $site_terms = array(); public $sql_join = ''; public $sql_where = ''; function __construct() { // add filters add_filter( 'init', array( &$this, 'populates_site_terms' ) ); add_filter( 'pre_get_posts', array( &$this, 'filter_query' ) ); } function populates_site_terms() { // my actual function does some processing and // checks caches and combines IDs from multiple // different sources here and then sets site_terms $this->site_terms = array( 1, 2, 3 ); } function filter_query( $query ) { // not the main query? if ( !$query->is_main_query() ) { return $query; } // have terms to filter by? if ( !empty( $this->site_terms ) ) { // construct tax_query $tax_query = array( 'taxonomy' => 'site_category', 'field' => 'id', 'terms' => $this->site_terms, 'operator' => 'IN' ); // this needs to be an array of arrays $taxquery = array( $tax_query ); // set this.. $query->set( 'tax_query', $taxquery ); if ( $query->is_singular ) { global $wpdb; $q = &$query->query_vars; $q['suppress_filters'] = false; $query->parse_tax_query( $q ); $clauses = $query->tax_query->get_sql( $wpdb->posts, 'ID' ); $this->sql_join .= $clauses['join']; $this->sql_where .= $clauses['where']; } } return $query; } function filter_join( $join ) { if ( !empty( $this->sql_join ) ) { $join .= $this->sql_join; } return $join; } function filter_where( $where ) { if ( !empty( $this->sql_where ) ) { $where .= $this->sql_where; } return $where; } } // not the admin? init class if ( !is_admin() ) { $pf_override = new PF_override(); } ?>This part was added:
if ( $query->is_singular ) { global $wpdb; $q = &$query->query_vars; $q['suppress_filters'] = false; $query->parse_tax_query( $q ); $clauses = $query->tax_query->get_sql( $wpdb->posts, 'ID' ); $this->sql_join .= $clauses['join']; $this->sql_where .= $clauses['where']; }Forum: Fixing WordPress
In reply to: tax_query not working, anything change in latest version?Well it seems after digging in to the code, tax_query is being blocked on single post/page pages which is why I’m running in to this issue.
If you see the ability to run tax_query in all circumstances as beneficial, please voice your opinion on trac.
See ticket here:
http://core.trac.wordpress.org/ticket/24819Apologies, I should have looked more in depth in to the documentation.
I’d like to suggest making this the default setting if the media picker is also added to the custom field.
Forum: Plugins
In reply to: [JSON API] Blank pages for all custom API calls after updateMy custom controllers and their methods show in the admin panel too.
Forum: Plugins
In reply to: [JSON API] Blank pages for all custom API calls after updateI reverted to 1.0.7 and I get my API calls back.
Forum: Plugins
In reply to: [JSON API] JSON encode character encodingThat’s awesome, thank you.
Forum: Plugins
In reply to: [JSON API] how to get pageviews?the plugin uses the_views as a custom field.
You will want to create a query that returns the custom field the_views for the posts.