@@ -882,9 +882,6 @@ public function setup_content_types( $force = false ) {
882
882
$ ct_post_types = $ options ['post_types ' ];
883
883
$ options = $ options ['options ' ];
884
884
885
- $ options = apply_filters ( 'pods_register_taxonomy_ ' . $ taxonomy , $ options , $ taxonomy );
886
- $ options = apply_filters ( 'pods_register_taxonomy ' , $ options , $ taxonomy );
887
-
888
885
$ options = self ::object_label_fix ( $ options , 'taxonomy ' );
889
886
890
887
/**
@@ -908,6 +905,24 @@ public function setup_content_types( $force = false ) {
908
905
pods_debug ( array ( $ taxonomy , $ ct_post_types , $ options ) );
909
906
}
910
907
908
+ /**
909
+ * Allow filtering of taxonomy options per taxonomy.
910
+ *
911
+ * @param array $options Taxonomy options
912
+ * @param string $taxonomy Taxonomy name
913
+ * @param array $ct_post_types Associated Post Types
914
+ */
915
+ $ options = apply_filters ( 'pods_register_taxonomy_ ' . $ taxonomy , $ options , $ taxonomy , $ ct_post_types );
916
+
917
+ /**
918
+ * Allow filtering of taxonomy options.
919
+ *
920
+ * @param array $options Taxonomy options
921
+ * @param string $taxonomy Taxonomy name
922
+ * @param array $ct_post_types Associated post types
923
+ */
924
+ $ options = apply_filters ( 'pods_register_taxonomy ' , $ options , $ taxonomy , $ ct_post_types );
925
+
911
926
register_taxonomy ( $ taxonomy , $ ct_post_types , $ options );
912
927
913
928
if ( ! empty ( $ options ['show_in_rest ' ] ) ) {
@@ -926,9 +941,6 @@ public function setup_content_types( $force = false ) {
926
941
continue ;
927
942
}
928
943
929
- $ options = apply_filters ( 'pods_register_post_type_ ' . $ post_type , $ options , $ post_type );
930
- $ options = apply_filters ( 'pods_register_post_type ' , $ options , $ post_type );
931
-
932
944
$ options = self ::object_label_fix ( $ options , 'post_type ' );
933
945
934
946
// Max length for post types are 20 characters
@@ -943,6 +955,22 @@ public function setup_content_types( $force = false ) {
943
955
pods_debug ( array ( $ post_type , $ options ) );
944
956
}
945
957
958
+ /**
959
+ * Allow filtering of post type options per post type.
960
+ *
961
+ * @param array $options Post type options
962
+ * @param string $post_type Post type name
963
+ */
964
+ $ options = apply_filters ( 'pods_register_post_type_ ' . $ post_type , $ options , $ post_type );
965
+
966
+ /**
967
+ * Allow filtering of post type options.
968
+ *
969
+ * @param array $options Post type options
970
+ * @param string $post_type Post type name
971
+ */
972
+ $ options = apply_filters ( 'pods_register_post_type ' , $ options , $ post_type );
973
+
946
974
register_post_type ( $ post_type , $ options );
947
975
948
976
// Register post format taxonomy for this post type
0 commit comments