Fetch data of 2 relational Custom Post in WordPress
Fetch data of 2 relational Custom Post in WordPress
Fetch data of 2 relational Custom Post in WordPress
fetchRecord will load the next record and is only for use when you’re using findRecords. When you give an ID to the Pod class, it will automatically fetchRecord for that ID, so calling it again will result in an empty return. Try $pod->data instead.
To add submenu items to a specific Pod’s menu, try this: add_submenu_page( ‘pods-manage-your_pod_name’, ‘My submenu item page title’, ‘My submenu item’, ‘manage_options’, ‘pods-manage-your_pod_name-my-submenu-item’, ‘your_callback_function’ ); Do this during the admin_menu action in WordPress, or alternatively do it during the ‘pods_admin_menu’ action.
Advanced Content Types and Pod Pages are separate from WordPress post types. They do not currently show up in the navigation menu management area. This is a feature we are working on including in the future. https://github.com/pods-framework/pods/issues/1053
You can use map_meta_cap() to set more specific capabilities for your CPT. So instead of using the built-in edit_posts and edit_others_posts capabilities you would create edit_locations and edit_others_locations – thus allowing a new custom role to edit their own locations, but not edit_others_locations. You may find this related question helpful: Using Custom Meta Capabilities on … Read more
Already solved using this code inside functions.php: add_action(‘template_redirect’, function() { if (is_single() && get_post_type(get_queried_object_id()) == ‘sorteio’) wp_redirect(‘edicao/?id=’ . get_queried_object_id()); });
OK, for those who need, you can do the following: Install Code Snippets In a code snippet: add_filter( ‘init’, function( ) { define(‘PODS_SHORTCODE_ALLOW_SUB_SHORTCODES’, true); }); That will define it without modifying wp-config.php
Welcome! After creating a post type using pods, You can navigate to Advanced options and uncheck Public and Publicly Queryable. Note: There are parameters like exclude_from_search, publicly_queryable, show_ui, and show_in_nav_menus that are inheriting value from public. You need to set them manually if you want to use them. More info: https://developer.wordpress.org/reference/functions/register_post_type/
If we look at the register_post_type documentation, in the rewrite option, there is a sub-option that controls this: ‘with_front’ => bool Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true So something like this: … ‘rewrite’ => … Read more
In this case, since there’s a many-to-many relationship between movies and actors, I recommend making them two separate pods with a relationship between them. See the intro video at https://pods.io/ … I don’t remember where he explains relationship fields but it’s all in there. You don’t need to use PHP if you don’t want to. … Read more