Skip to content

Commit

Permalink
added missing filter for initFields method
Browse files Browse the repository at this point in the history
  • Loading branch information
sincspecv committed Feb 26, 2020
1 parent 5b7a5c3 commit f671865
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions acf-to-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ function __construct() {
Fields::init();
FormatFieldType::init();

$this->initLayouts();
$this->initFields();
$this->initGroups();
add_action( 'plugins_loaded', [$this, 'initLayouts'] );
add_action( 'plugins_loaded', [$this, 'initFields'] );
add_action( 'plugins_loaded', [$this, 'initGroups'] );
}

/**
Expand All @@ -76,11 +76,8 @@ private function autoload() {
*
* @since 0.1.0
*/
private function initLayouts() {
$layouts = [
Hero::class,
];
$layouts = apply_filters( 'acf_to_post/init/layouts', $layouts );
public function initLayouts() {
$layouts = apply_filters( 'acf_to_post/init/layouts', [] );

if( ! empty( $layouts ) ) {
foreach( $layouts as $layout ) {
Expand All @@ -93,10 +90,8 @@ private function initLayouts() {
}
}

private function initFields() {
$fields = [
Modules::class,
];
public function initFields() {
$fields = apply_filters( 'acf_to_post/init/fields', [] );

if( ! empty( $fields ) ) {
foreach( $fields as $field ) {
Expand All @@ -117,11 +112,8 @@ private function initFields() {
*
* @since 0.1.0
*/
private function initGroups() {
$groups = [
Page::class,
];
$groups = apply_filters( 'acf_to_post/init/groups', $groups );
public function initGroups() {
$groups = apply_filters( 'acf_to_post/init/groups', [] );

if( ! empty( $groups ) ) {
foreach( $groups as $group ) {
Expand Down

0 comments on commit f671865

Please sign in to comment.