JuniperPaul
Forum Replies Created
-
I see that the issue I’m having is solved by the “Avoid overlapping between services” feature of your Pro version.
https://apphourbooking.dwbooster.com/blog/2019/07/25/book-multiple-services-timeslot/
I’m disappointed that such fundamental functionality is hidden behind a pay wall.
Good call on the role check~
If you’ll permit a quick aside on coding dynamics, I recommend that you keep that single exit point from your function for greater robustness and elegance. Rather than creating two exit points from your function by returning TRUE from inside the loop, simply set your flag and break out of the loop so that your final
return apply_filters()statement always processes the result.Also, I’d test for is_array($user->roles) only once. Like is_object($user), there’s no point in iterating through the foreach loop if roles isn’t an array.
function is_vendor($user_id) { $user = get_userdata( $user_id ); $vendor_roles = apply_filters( 'wcvendors_vendor_roles', array( 'vendor') ); $is_vendor = false; if (is_object($user) && is_array($user->roles)) { foreach ($vendor_roles as $role ) { if(in_array($role, $user->roles) ) { $is_vendor = true; break; } } } return apply_filters( 'pv_is_vendor', $is_vendor, $user_id ); }(Pardon my preference for Allman style indentation.)
- This reply was modified 8 years, 1 month ago by JuniperPaul.
- This reply was modified 8 years, 1 month ago by JuniperPaul.
To be more specific, using WC Vendors 1.9, the template file goes into the
/MYTHEME/woocommerce/directory itself and not into an/emails/sub-directory:WC Vendors itself places the template at:
/wp-content/plugins/wc-vendors/templates/emails/application-status.phpOur override template ordinarily resides at:
/wp-content/themes/MYTHEME/wc-vendors/emails/application-status.phpbut WC Vendors 1.9 requires us to put it:
/wp-content/themes/MYTHEME/woocommerce/application-status.phpPaul
- This reply was modified 8 years, 1 month ago by JuniperPaul.
Holy cannoli! Thanks for letting me know.
I strongly recommend that you put a note to this effect immediately on your “Changing the Vendor Templates” page and kick out a quick plugin update to save other developers the time I wasted trying fruitlessly to troubleshoot this problem at my end and finally giving up and (ugh) modifying the installed plugin directly.
Dusting myself off and charging ahead,
Paul- This reply was modified 8 years, 1 month ago by JuniperPaul.
I’m getting the same error on line 1689 with CPT 1.3.5 and WP 4.7. It looks like this script initializes
$args[ 'fields' ]inside if-tests, so a simple unconditional setting early on might nip this in the bud. Or flesh out the if-test at 1689 by testing to see if the index is set as you do elsewhere:if ( isset( $args[ 'fields' ] ) && 'tt_ids' == $args[ 'fields' ] )Best of luck keeping all your plates spinning! Your work is greatly appreciated. We all know how hard it is to pull that off with a minimum of crockery shards.
Warmly,
PaulForum: Plugins
In reply to: [Simple Page Ordering] Allowing indenting of items to make them childrenI’ll review your code with an eye to seeing how to translate a sideways drag & drop into a change in an item’s parent. Dragging and dropping sideways should make the dropped item become the child of the closest previous item with a lesser ‘indent.’ It might be helpful to walk the page array adding the nesting level of each page. It’s possible that the WordPress admin menu editor might provide a good working model.
Paul
Forum: Plugins
In reply to: [Simple Page Ordering] Allowing indenting of items to make them childrenIn my own testing, the Simple Page Ordering plugin works wonderfully with one limitation: A page cannot be made the child of another page that does not already have children. For that, you need to edit the page (e.g. Quick Edit without leaving the page listing) and select the Parent.
Other than that, however, this plugin functions well. You can move a page by dropping it above a page you want to be its new sibling or below a page you want to become its new parent (IFF that target already has children). If you move a page that already has children, it brings its children with it, including moving a family to a new level.
For re-ordering within this limitation, this plugin out-performs native WordPress which itself does not immediately adjust position when we change the Order or Parent values in Quick Edit. WordPress by itself requires us to reload the page listing to see the new relationship in page sequence and indenting.
Cheers,
PaulForum: Plugins
In reply to: [WP-Members Membership Plugin] redirect to email link after loginThanks, I’ll try that. (A usage example would be helpful if you have a minute.)
(For the benefit of future readers, that documentation link is http://rocketgeek.com/plugins/wp-members/users-guide/customizing-emails/email-shortcodes/ without the close-paren.)
Forum: Plugins
In reply to: [Custom Post Type Creator] plugin conflict with add_action('add_meta_boxes')Specifically, I was trying out your WCK Custom Meta Boxes plugin. For a long time I’ve been enjoying the rich functionality of Hiroaki Miyashita‘s Custom Field Template, but its user interface is best used by a programmer and I’m always on the lookout for something menu-driven that my non-technical clients can use.
I also had your WCK Post Type Creator and WCK Taxonomy Creator installed so I could assess them as a family, but I wasn’t using them to create any post types or taxonomies. The CPT-onomies error message is triggered when I select WCK > Post Type Creator or WCK > Taxonomy Creator to display the input fields for a new post type or taxonomy. Rachel Carden makes a persuasive argument that this represents a flaw in your plugins. I’m posting this to help you fix that problem.
Yes, I use the CPT-onomies plugin because it lets us assign a post type as a taxonomy to another post type. This added functionality has been profoundly helpful in my work. CPT-onomies would not be necessary if WordPress’s taxonomy terms had all the richness of posts or pages, but they don’t and it is.
Regards,
PaulForum: Plugins
In reply to: [Custom Post Type Creator] plugin conflict with add_action('add_meta_boxes')I posted this same problem to the CPT-onomies plugin support forum, and Rachel’s response is illuminating:
I installed that plugin on my testing site and did some digging and it looks like the problem is when the action is invoked in the WCK plugin.
Look in the wordpress-creation-kit.php file in the wordpress-creation-kit-api folder on line 1071: do_action( ‘add_meta_boxes’, $this->hookname ); is missing the second argument.
But, really, the ‘add_meta_boxes’ action shouldn’t be used on settings pages because it’s intended for dealing with posts, which is the why the missing second argument should be a variable containing post information.
In CPT-onomies, I hook into an admin_head action to add my settings page meta boxes.
PS: Of course it’s worth noting that the post type editor I’m using here is part of the TheCartPress plugin. The custom post types it creates appear to be solid in all other respects.
I did try creating a minimal Test post type using your plugin but that resulted in a cascade of PHP errors starting with “Warning: trim() expects parameter 1 to be string, array given in […]/wp-content/plugins/cpt-onomies/admin-settings.php on line 290” on a line referring to $cpt[ ‘capability_type’ ]. At this point I assume that the script was expecting me to fill in a field I’d left blank; I’ll explore that anon.
A plugin conflict is a possibility but I’m hoping it’s resolvable as I’d very much like to use both TheCartPress and CPT-onomies.
Cheers,
PaulHere are some screenshots that illustrate my situation. The problem occurs with all of the post type relationships I’ve created, but here I’ll illustrate with Merchants assigned as a taxonomy in the Artisans post:
- The CPT-onomies main screen showing the custom post type relationships.
- The CPT-onomies detail screen showing that Merchants are assigned to the Artisan post type.
- The Merchant post type editor showing that ‘hierarchical’ is selected.
- The Artisan post editor showing that Merchants (and Products) appear as autocomplete, not checklist.
When I add filter code to my functions script returning ‘checklist’ when the post type name is one of my CPTs, the problem with the checklist goes away:
add_filter( 'custom_post_type_onomies_meta_box_format', 'artsquest_custom_post_type_onomies_meta_box_format', 1, 3 ); function artsquest_custom_post_type_onomies_meta_box_format( $format, $taxonomy, $post_type ) { switch ($post_type) { case 'aq_merchant': case 'aq_artisan': case 'tcp_product': case 'aq_curator': $format = 'checklist'; break; } // WordPress filters must always return a value return $format; }Let me know if you need to see more.
Thanks,
PaulMy custom post types were set to hierarchical but I wasn’t getting checkboxes. Am I missing something? I don’t see any other place within the admin UI to set a hierarchical attribute on any object.
Cheers,
PaulRe: my post above, the taxonomic relationships were correctly assigned using Quick Edit. The error message appears to occur on re-display.