Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created June 14, 2016 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/89e9cfc646c017b7ab5a36521692677f to your computer and use it in GitHub Desktop.
Save billerickson/89e9cfc646c017b7ab5a36521692677f to your computer and use it in GitHub Desktop.
<?php
/**
* ACF Rule Type: Page Ancestor
*
* @author Bill Erickson
* @see http://www.billerickson.net/acf-custom-location-rules
*
* @param array $choices, all of the available rule types
* @return array
*/
function ea_acf_rule_type_page_ancestor( $choices ) {
$choices['Page']['page_ancestor'] = 'Page Ancestor';
return $choices;
}
add_filter( 'acf/location/rule_types', 'ea_acf_rule_type_page_ancestor' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment