-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #552 from equalizedigital/release/1.10.1
Release/v1.10.1
- Loading branch information
Showing
29 changed files
with
721 additions
and
166 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Class for handling the editor meta box. | ||
* | ||
* @package Accessibility_Checker | ||
*/ | ||
|
||
namespace EDAC\Admin; | ||
|
||
/** | ||
* Class Meta_Box | ||
* | ||
* Handles the editor meta box registration and rendering. | ||
*/ | ||
class Meta_Boxes { | ||
|
||
/** | ||
* Initialize the hooks for the editor meta box. | ||
* | ||
* @return void | ||
*/ | ||
public function init_hooks(): void { | ||
add_action( 'add_meta_boxes', array( $this, 'register_meta_boxes' ) ); | ||
} | ||
|
||
/** | ||
* Register custom meta boxes for each post type. | ||
* | ||
* @since 1.10.0 | ||
* | ||
* @return void | ||
*/ | ||
public function register_meta_boxes(): void { | ||
$post_types = get_option( 'edac_post_types' ); | ||
if ( $post_types ) { | ||
foreach ( $post_types as $post_type ) { | ||
add_meta_box( | ||
'edac-meta-box', | ||
__( 'Accessibility Checker', 'accessibility-checker' ), | ||
array( $this, 'render' ), | ||
$post_type, | ||
'normal', | ||
'high' | ||
); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Render the custom meta box html. | ||
* | ||
* @since 1.10.0 | ||
* | ||
* @return void | ||
*/ | ||
public function render(): void { | ||
do_action( 'edac_before_meta_box' ); | ||
include_once plugin_dir_path( __DIR__ ) . 'partials/custom-meta-box.php'; | ||
do_action( 'edac_after_meta_box' ); | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.