Jory Hogeveen
Forum Replies Created
-
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] How to use Magic tag in javascriptHi @mableb
Magic tags are not Javascript and unfortunately cannot not be supported by Javascript.
The only solution I can think of is to add the info you need as a <script> tag within your Pods templates and add the information in there using magic tags.
Hope this helps!
Cheers, Jory
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Sorting pods with shortcodeYou’ve missed the
t.
prefix ??
https://docs.pods.io/code/pods/find/find-reference-table/#Field_Syntax_ReferenceCheers, Jory
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Pods plugin performance issuesHi @arhamm
Issues like this are the most complex to figure out. Load times of 1+ minutes are usually related to external calls. Just as a starting point, did you test the performance with only Pods active on a default theme?
Cheers, Jory
Hi @aquila76
Please check our file based configurations: https://docs.pods.io/code/registering-configurations/
Cheers, Jory
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] pods-form Shortcode not WorkingHi @gualam
Did you update to the latest Pods version? And if so, please check the new security updates for forms and dynamic data since v3.1!
https://pods.io/2024/02/21/pods-3-1-feature-release-access-rights-revamp/
Cheers, Jory
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Database error SQL select distinctHi @influactive
I don’t see an image attached to this post.
Just to be sure, did you check for incompatibilities? https://docs.pods.io/faqs/plugin-theme-conflicts/A database error it not for no reason and probably related to bad SQL. Luckily with the right info it’s usually an easy fix!
Please give us more info about the exact error and what info comes with it. Also what is on your homepage (a link would help) so we can investigate what the error might be.Cheers! Jory
Hi @spypots
Please check the field options, you can customize the output of your relationship fields.
I also recall that Elementor Pro has updated their compatibility with Pods relationships. https://elementor.com/help/elementor-integration-with-pods/
If you need more flexibility for dynamic data in Page Builders then you could also check our PageBuilder Toolkit addon: https://pods-pro.skc.dev/downloads/page-builder-toolkit/
Cheers, Jory
Hi @rico34
Pods page (post) types are actually the same as WordPress core post types. It’s basically an interface in which you can easily create them without PHP code (along with other extra options like fields).
As for the general structure. Pages (post type: page) are usually not categorised as these are just pages in your website/app, each with it’s own structure and content.
So to properly answer this question, I would think that it’s likely a combination of pages and custom post types.
Just for example, I would consider the following post types separate from pages: products, events, testimonals, reviews, jobs, case-studies, etc.
While you could add these as regular pages it might be better to add them as custom post types (either through Pods or PHP) and let them have their own categories (and tags) through custom taxonomies.I would advice you to check this page: https://docs.pods.io/faqs/what-can-you-build-with-pods/ and watch the video’s mentioned!
As for your last question. If Pods is deactivated your content will still be available (unless specifically removed). However, the registration of the post and taxonomy types isn’t done anymore so you won’t be able to view them until you register them through some other way.
Hope this helps!
Cheers, Jory
Forum: Plugins
In reply to: [Pods - Custom Content Types and Fields] Using “Where” in pods shortcodeHi @kaostc
Since the latest security updates we added an extra tab for each Pod you create in which you can define what options should be allowed or not. Please check these configs for the team_member post type Pod.
Cheers, Jory
Forum: Plugins
In reply to: [View Admin As] Use plugin on a custom role but limit on shopmanagerHi @tanasi
I also just noticed an issue with my code, apparently the roles are set as the array keys.
New code (this time the php prefix)<?php add_filter( 'editable_roles', function( $roles ) { $user = wp_get_current_user(); $editable_roles = []; // Define your logic to enable/disable role edits for the current user. // For example: if ( in_array( 'seller', $user->roles ) ) { $editable_roles = [ 'subscriber', 'editor' ]; // Only allow viewing subscriber and editor. } if ( $editable_roles ) { return array_intersect_key( $roles, array_flip( $editable_roles ) ); } return $roles; } );
Hope this helps!
Cheers, Jory
Forum: Plugins
In reply to: [View Admin As] Use plugin on a custom role but limit on shopmanagerHi @tanasi
Ah you’ve just copied the code. Please make sure that the names for these roles are 100% correct. I’ve written them based on your writings but it could well be that the internal name is different.
Edit: You did add a
<php
to the file right? And I also see an HTML entity in your copied code. The code was meant as an example, you should changed it to match your actual installation.Also, note that your need to login as a Seller role user in order to see the changes in your View Admin As menu.
Cheers, Jory
- This reply was modified 6 months, 3 weeks ago by Jory Hogeveen.
Forum: Plugins
In reply to: [View Admin As] Use plugin on a custom role but limit on shopmanagerCould you share the code you’ve used in your mu-plugin?
Creds are not allowed to be shared through the forums.
Cheers, Jory
Forum: Plugins
In reply to: [View Admin As] Issue with url parameters for adminsHi @johannesdb
Just a heads-up. The release has a bit of a delay as I’m trying to get unit tests up and running.
Rest assured that the nest release will include this patch anyway so your local patch will be fine in any case!Cheers, Jory
Forum: Plugins
In reply to: [View Admin As] Use plugin on a custom role but limit on shopmanagerHi @tanasi
Sorry, I always forget to mention that filters made for this plugin should be added as a plugin or even better, as a mu-plugin. With the latter you can just put the same code in a PHP file and put it a
/wp-content/mu-plugins
.Since the code for VAA runs so early, adding it in your theme will be to late as all validations have run already.
It might be a nice addon to the plugin to be able to edit them using the UI.
Cheers, Jory
Forum: Plugins
In reply to: [View Admin As] Use plugin on a custom role but limit on shopmanagerHi @tanasi
Thank you! And yes, this is definitely possible.
In fact, it’s always recommended to limit the capabilities if you are allowing users to create/edit users.Luckily, WordPress core has a built-in filter for this:
editable_roles
: https://developer.www.ads-software.com/reference/hooks/editable_roles/Example (see also level_# example in doc page above):
add_filter( 'editable_roles', function( $roles ) { $user = wp_get_current_user(); // Define your logic to enable/disable role edits for the current user. // For example: if ( in_array( 'seller', $user->roles ) ) { $roles = [ 'subscriber', 'editor' ]; // Only allow viewing subscriber and editor. } return $roles; } );
Note that some plugins allow you to add multiple roles to a user, this will require you to improve the code above to validate all the user roles instead of just one.
Hope this helps!
Cheers, Jory