We can use the standard WordPress pre_get_posts hook to modify the query that retrieves the list of parent posts.
To limit its scope, edit the following code to change the ID of the page where the CRED child post form is inserted and the slug of the parent post type.
/** * Limit CRED parent post selector to own posts */ function filter_parent_posts( $query ){ $target_page = 102; // ID of page with CRED form, or string of page slug $parent_post_type = "thing"; // slug of parent post type if ( is_page( $target_page ) && $query->get( 'post_type') == $parent_post_type ) { $current_user = get_current_user_id(); $query->set( 'author', $current_user ); } } add_action( 'pre_get_posts', 'filter_parent_posts' );
Note that when there are more than 15 possible parent posts to choose from the select2 JS library is added to the parent select dropdown which will break the above code. You can disable the select2 library for the parent selector by adding the attribute use_select2=”never” to the cred_field shortcode used to insert the parent selector in the form.
I produced a slightly more complex test that should also work on CRED edit forms and when select2 is enabled and the query takes place via ajax. This code is by way of illustration only, and depending on the specifics of the site the tests may or may not target the relevant query accurately enough.
/** * Limit CRED parent post selector to own posts */ function filter_parent_posts( $query ){ $target_page = 102; // ID of page with CRED form, or string of page slug $parent_post_type = "thing"; // slug of parent post type $child_post_type = "thingy"; // slug of child post type if ( ( is_page( $target_page ) || is_singular( $child_post_type ) || ( defined('DOING_AJAX') && DOING_AJAX ) ) && $query->get( 'post_type') == $parent_post_type ) { $current_user = get_current_user_id(); $query->set( 'author', $current_user ); } } add_action( 'pre_get_posts', 'filter_parent_posts' );