Skip to content

Commit

Permalink
Merge pull request CMB2#197 from WebDevStudios/scrutinizer-patch-1
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
jtsternberg committed Feb 15, 2015
2 parents 5c669eb + 9b7140a commit f2d53de
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions example-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* Get the bootstrap! If using the plugin from wordpress.org, REMOVE THIS!
*/

if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
require_once dirname( __FILE__ ) . '/cmb2/init.php';
} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
require_once dirname( __FILE__ ) . '/CMB2/init.php';
}

Expand All @@ -28,9 +28,9 @@
*
* @return bool True if metabox should show
*/
function yourprefix_hide_if_no_cats( $field ) {
function yourprefix_hide_if_no_cats( $field ) {
// Don't show this field if not in the cats category
if ( ! has_tag( 'cats', $field->object_id ) ) {
if ( ! has_tag( 'cats', $field->object_id ) ) {
return false;
}
return true;
Expand All @@ -42,10 +42,10 @@ function yourprefix_hide_if_no_cats( $field ) {
* @param array $field_args Array of field parameters
* @param CMB2_Field object $field Field object
*/
function yourprefix_before_row_if_2( $field_args, $field ) {
if ( 2 == $field->object_id ) {
function yourprefix_before_row_if_2( $field_args, $field ) {
if ( 2 == $field->object_id ) {
echo '<p>Testing <b>"before_row"</b> parameter (on $post_id 2)</p>';
} else {
} else {
echo '<p>Testing <b>"before_row"</b> parameter (<b>NOT</b> on $post_id 2)</p>';
}
}
Expand All @@ -54,7 +54,7 @@ function yourprefix_before_row_if_2( $field_args, $field ) {
/**
* Hook in and add a demo metabox. Can only happen on the 'cmb2_init' hook.
*/
function yourprefix_register_demo_metabox() {
function yourprefix_register_demo_metabox() {

// Start with an underscore to hide fields from custom fields list
$prefix = '_yourprefix_demo_';
Expand Down Expand Up @@ -338,7 +338,7 @@ function yourprefix_register_demo_metabox() {
/**
* Hook in and add a metabox that only appears on the 'About' page
*/
function yourprefix_register_about_page_metabox() {
function yourprefix_register_about_page_metabox() {

// Start with an underscore to hide fields from custom fields list
$prefix = '_yourprefix_about_';
Expand Down Expand Up @@ -369,7 +369,7 @@ function yourprefix_register_about_page_metabox() {
/**
* Hook in and add a metabox to demonstrate repeatable grouped fields
*/
function yourprefix_register_repeatable_group_field_metabox() {
function yourprefix_register_repeatable_group_field_metabox() {

// Start with an underscore to hide fields from custom fields list
$prefix = '_yourprefix_group_';
Expand Down Expand Up @@ -434,7 +434,7 @@ function yourprefix_register_repeatable_group_field_metabox() {
/**
* Hook in and add a metabox to add fields to the user profile pages
*/
function yourprefix_register_user_profile_metabox() {
function yourprefix_register_user_profile_metabox() {

// Start with an underscore to hide fields from custom fields list
$prefix = '_yourprefix_user_';
Expand Down Expand Up @@ -506,7 +506,7 @@ function yourprefix_register_user_profile_metabox() {
/**
* Hook in and register a metabox to handle a theme options page
*/
function yourprefix_register_theme_options_metabox() {
function yourprefix_register_theme_options_metabox() {

// Start with an underscore to hide fields from custom fields list
$option_key = '_yourprefix_theme_options';
Expand Down

0 comments on commit f2d53de

Please sign in to comment.