Created
September 19, 2023 20:57
-
-
Save coulterpeterson/ab37eb5d158756a42003f833343b8394 to your computer and use it in GitHub Desktop.
GP Populate Anything Register Custom Data Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'plugins_loaded', 'register_object' ); | |
function register_object() { | |
if ( class_exists( 'GP_Populate_Anything' ) && class_exists( 'GPPA_Object_Type' ) ) { | |
// For a starter class file, you can copy one from source like | |
// wp-content\plugins\gp-populate-anything\includes\class-object-type-post.php | |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-object-type-YOURTYPE.php'; | |
gp_populate_anything()->register_object_type( 'yourtype', 'GPPA_Object_Type_YOURTYPE' ); | |
} else { | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment