wdm
Forum Replies Created
-
Forum: Plugins
In reply to: Pass array to query_varsThere is a kind-of workaround, by explicitly adding the
query_vars
from$_GET
:function parse_query_vars($query) { if ( isset($_GET['multi-cat']) ) { $query->query_vars['multi-cat'] = $_GET['multi-cat']; var_dump($query); } }
The var_dump now reports:
["query_vars"]=> array(1) { ["multi-cat"]=> array(2) { [0]=> string(1) "6" [1]=> string(2) "10" } }
Unfortunately custom rewrite rules don’t seem to work with this method.
Forum: Plugins
In reply to: Pass array to query_varsHere is the code:
function add_query_vars($query_vars) { $query_vars[] = 'multi-cat'; return $query_vars; }
With the url
blog.com/?multi-cat[]=6&multi-cat[]=10
(GET vars come from a multiple category widget I’m working on, the selects are each named ‘multi-cat[]’ to create an array of category IDs).
function parse_query_vars($query) { var_dump($query); }
The resulting var_dump shows the array is recognised, but cast to a string:
["query_vars"]=> array(1) { ["multi-cat"]=> string(5) "Array" }
Forum: Fixing WordPress
In reply to: Tags return “-1” for user level Author or below in WP 2.7.1It seems to be something to do with the manage_categories capability
Forum: Fixing WordPress
In reply to: Category Base Removal and Category Pagination (Revisited)Any news?
Forum: Fixing WordPress
In reply to: relative URL converted to abs URL in Visual Editor 2.5don’t forget to add commas – so the array in your
wp-includes/js/tinymce/tiny_mce_config.php
should end like:‘old_cache_max’ => ‘1’, // number of cache files to keep
‘convert_urls’ => false,
‘relative_urls’ => true’Forum: Themes and Templates
In reply to: How to remove “/category” from the category URL?Hmm… it did work, but not anymore.
Seems not to work all the time, anyone know why?Forum: Fixing WordPress
In reply to: How do you show an attachment without linking to the raw fileYou could try:
echo '<img src="' . wp_get_attachment_url($attachment->ID) . '"/>';
Why are there 3 functions for doing basically the same thing???
the_attachment_link get_the_attachment_link wp_get_attachment_url
Forum: Themes and Templates
In reply to: How to remove “/category” from the category URL?Using “/.” (without quotes) as the category base should work