From 04d18b50ad04b9f2153ab6fb5094aab07f70929a Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Fri, 4 Nov 2016 10:49:04 -0500 Subject: [PATCH 1/5] Update class-pods_templates.php --- components/Templates/class-pods_templates.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/Templates/class-pods_templates.php b/components/Templates/class-pods_templates.php index 1623e333ad..405335758b 100644 --- a/components/Templates/class-pods_templates.php +++ b/components/Templates/class-pods_templates.php @@ -212,6 +212,13 @@ function add_metaboxes( $slug, $post = false ) { 'slug' => 'pod_reference', 'groups' => array() ) ); + add_meta_box( 'pod_reference', __( 'Magic Tag Reference', 'pods' ), array( + $this, + 'render_metaboxes_custom' + ), '_pods_template', 'side', 'default', array( + 'slug' => 'tag_reference', + 'groups' => array() + ) ); } From c18ce0b255542caf695ea08258841e8dc1ec72ff Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Fri, 4 Nov 2016 10:50:40 -0500 Subject: [PATCH 2/5] Create element-magic_tag_reference.php --- components/Templates/includes/element-magic_tag_reference.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 components/Templates/includes/element-magic_tag_reference.php diff --git a/components/Templates/includes/element-magic_tag_reference.php b/components/Templates/includes/element-magic_tag_reference.php new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/components/Templates/includes/element-magic_tag_reference.php @@ -0,0 +1 @@ + From a02c69977630d00fb3685551b01aa2f472a302d5 Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Fri, 4 Nov 2016 10:52:13 -0500 Subject: [PATCH 3/5] Rename element-magic_tag_reference.php to element-tag_reference.php --- ...{element-magic_tag_reference.php => element-tag_reference.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename components/Templates/includes/{element-magic_tag_reference.php => element-tag_reference.php} (100%) diff --git a/components/Templates/includes/element-magic_tag_reference.php b/components/Templates/includes/element-tag_reference.php similarity index 100% rename from components/Templates/includes/element-magic_tag_reference.php rename to components/Templates/includes/element-tag_reference.php From b8263aa7098189ccb959a022dc136cc161b2476b Mon Sep 17 00:00:00 2001 From: JoryHogeveen Date: Thu, 19 Mar 2020 12:50:04 +0100 Subject: [PATCH 4/5] Codestyle --- components/Templates/class-pods_templates.php | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/components/Templates/class-pods_templates.php b/components/Templates/class-pods_templates.php index aeb4b5a985..c1e6e54c92 100644 --- a/components/Templates/class-pods_templates.php +++ b/components/Templates/class-pods_templates.php @@ -204,30 +204,48 @@ public function add_metaboxes( $slug, $post = false ) { // add metabox add_meta_box( - 'view_template', __( 'Template', 'pods' ), array( + 'view_template', + __( 'Template', 'pods' ), + array( $this, 'render_metaboxes_custom', - ), '_pods_template', 'normal', 'high', array( + ), + '_pods_template', + 'normal', + 'high', + array( 'slug' => 'view_template', 'groups' => array(), ) ); add_meta_box( - 'pod_reference', __( 'Pod Reference', 'pods' ), array( + 'pod_reference', + __( 'Pod Reference', 'pods' ), + array( $this, 'render_metaboxes_custom', - ), '_pods_template', 'side', 'default', array( + ), + '_pods_template', + 'side', + 'default', + array( 'slug' => 'pod_reference', 'groups' => array(), ) ); add_meta_box( - 'pod_reference', __( 'Magic Tag Reference', 'pods' ), array( + 'pod_reference', + __( 'Magic Tag Reference', 'pods' ), + array( $this, - 'render_metaboxes_custom' - ), '_pods_template', 'side', 'default', array( - 'slug' => 'tag_reference', - 'groups' => array() + 'render_metaboxes_custom', + ), + '_pods_template', + 'side', + 'default', + array( + 'slug' => 'tag_reference', + 'groups' => array(), ) ); From 1ab5e50769ef6905374611a09922907dbc87d480 Mon Sep 17 00:00:00 2001 From: JoryHogeveen Date: Thu, 19 Mar 2020 12:52:01 +0100 Subject: [PATCH 5/5] codestyle (callback) --- components/Templates/class-pods_templates.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/components/Templates/class-pods_templates.php b/components/Templates/class-pods_templates.php index c1e6e54c92..26f52758a9 100644 --- a/components/Templates/class-pods_templates.php +++ b/components/Templates/class-pods_templates.php @@ -202,14 +202,13 @@ public function add_metaboxes( $slug, $post = false ) { wp_enqueue_script( $this->plugin_slug . '-handlebars-baldrick', $this->get_url( 'assets/js/handlebars.baldrick2.js', __FILE__ ), array( 'jquery' ), self::VERSION, true ); wp_enqueue_style( $this->plugin_slug . '-pod_reference-styles', $this->get_url( 'assets/css/styles-pod_reference.css', __FILE__ ), array(), self::VERSION ); + $metabox_callback = array( $this, 'render_metaboxes_custom' ); + // add metabox add_meta_box( 'view_template', __( 'Template', 'pods' ), - array( - $this, - 'render_metaboxes_custom', - ), + $metabox_callback, '_pods_template', 'normal', 'high', @@ -221,10 +220,7 @@ public function add_metaboxes( $slug, $post = false ) { add_meta_box( 'pod_reference', __( 'Pod Reference', 'pods' ), - array( - $this, - 'render_metaboxes_custom', - ), + $metabox_callback, '_pods_template', 'side', 'default', @@ -236,10 +232,7 @@ public function add_metaboxes( $slug, $post = false ) { add_meta_box( 'pod_reference', __( 'Magic Tag Reference', 'pods' ), - array( - $this, - 'render_metaboxes_custom', - ), + $metabox_callback, '_pods_template', 'side', 'default',