webforge
Forum Replies Created
-
@mitcho – thanks for the fix. looking forward to the next beta ??
UPDATE:
If I comment out line 56 of yarpp.php
add_action('transition_post_status','yarpp_status_transition', 3);
the problem goes away – but post transitions are no longer handled (new in 3.2.1). Better to pass in
$old_status
and$post
correctly…Forum: Plugins
In reply to: [Plugin: WP BUSINESS DIRECTORY MANAGER] Category filtering and paging bugHi ampKathy,
In the above code, the
$args
array is set up to contain a list of parameters to pass to thequery_posts
function. Thequery_posts
function can return different lists of posts depending on what parameters are passed to it i.e.query_posts($args);
at line 170 ofposttemplate/wpbusdirman-category.php
In the first chunk of code above,
$args
passes through thecategory__in
parameter with the value of$wpbusdirman_postcatitems
. The$wpbusdirman_postcatitems
is an array that contains a list of all categories used by WPBDM – see the ‘Directory Category IDs’ option: Dashboard >> WPBusDirMan >> Manage Options. Passing through$wpbusdirman_postcatitems
as thecategory__in
parameter will get thequery_posts
function to return all posts from all categories (i.e. all posts in the Business Directory) used by WPBDM.This means that when you click on a category in the Business Directory listings page that you will get back a listing of all posts from all categories rather than just posts from the category that you clicked on.
The second chunk of code above fixes this issue by passing through the
cat
parameter instead (which expects a single value rather than an array) with the value set to the category id parameter from the clicked URL’s query string.In answer to your second question, at the moment the submit a listing form only allows for one category using the select box in the form. Multiple categories could be selected through the use of checkboxes or a select box allowing multiple selections. Perhaps for a future release???
In the meantime, a user submitting a listing will only be able to select one category. The administrator can of course select additional categories for the listing post when approving the listing…
@themestown – Good work so far with the plugin – I hope my contributions help with its development ??
After testing the above “fix” more completely, I discovered that while the zero fix worked for single digit dates, dates in the teens i.e. 11, 12 13 etc. now appeared as 21, 22, 23 etc. and 20 and 21 also appeared as 30, 31. Dates in the twenties that were above 21 were okay as 32, 33 etc. were not in the range of 01 – 31. So to fix it, I made all dates into proper strings eg. 1st, 2nd, 3rd and so on. Rather inelegant, especially for non-english speaking users, but it works.
For an otherwise great plugin, this bug makes the plugin almost unusable and definitely needs attention. Unfortunately I do not have time to wade through the php code to fix it properly, so hopefully the plugin developer (Takayuki Miyoshi) will address this issue in the next release.
Anyway, the following cludge should fix it:
<p><label>* Ceremony date: [select* Day "Day" "1st" "2nd" "3rd" "4th" "5th" "6th" "7th" "8th" "9th" "10th" "11th" "12th" "13th" "14th" "15th" "16th" "17th" "18th" "19th" "20th" "21st" "22nd" "23rd" "24th" "25th" "26th" "27th" "28th" "29th" "30th" "31st"] [select Month "Month" "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"] [select Year "Year" "2009" "2010" "2011" "2012" "2013" "2014" "2015"]</label></p>
Somehow or other, years are not affected by this bug, but if you use numbers for months, you will get similar weird behaviour. Hmmmm….
I had the same problem and solved it by prefixing single digit dates with a zero. The dates were then presumably handled as strings rather than numbers and the weird behaviour of adding 1 day stopped. So if you try the following, it should work properly:
<p><label>* Ceremony date: [select* Day "Day" "01" "02" "03" "04" "05" "06" "07" "08" "09" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" ] [select Month "Month" "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"] [select Year "Year" "2009" "2010" "2011" "2012" "2013" "2014" "2015"]</label></p>
Hope that helps ??