-
Notifications
You must be signed in to change notification settings - Fork 6
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 #70 from dartiss/develop
Version 2.4
- Loading branch information
Showing
5 changed files
with
119 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Meta boxes | ||
* | ||
* Functions related to meta-box management. | ||
* | ||
* @package simple-embed-code | ||
*/ | ||
|
||
// Exit if accessed directly. | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Remove Custom Fields | ||
* | ||
* Remove the custom field meta boxes if the user doesn't have the unfiltered HTML permissions. | ||
* | ||
* @param string $screen The screen identifier. | ||
* @param string $context The screen context for which to display meta boxes. | ||
* @param boolean $data_object Gets passed to the meta box callback function as the first parameter. | ||
*/ | ||
function sec_remove_custom_fields( $screen, $context, $data_object ) { | ||
|
||
if ( ! current_user_can( 'unfiltered_html' ) ) { | ||
|
||
$options = get_option( 'artiss_code_embed' ); | ||
|
||
if ( '1' !== $options['meta_box'] ) { | ||
remove_meta_box( 'postcustom', $screen, $context ); | ||
} | ||
} | ||
} | ||
|
||
add_action( 'do_meta_boxes', 'sec_remove_custom_fields', 1, 3 ); |
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