admin_plugin_url ) return $this->admin_plugin_url;
return $this->admin_plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) );
}
/*-----------------------------------------------------------------------------------*/
/* admin_plugin_dir() */
/*-----------------------------------------------------------------------------------*/
public function admin_plugin_dir() {
if ( $this->admin_plugin_dir ) return $this->admin_plugin_dir;
return $this->admin_plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
}
/*-----------------------------------------------------------------------------------*/
/* admin_pages() */
/*-----------------------------------------------------------------------------------*/
public function admin_pages() {
$admin_pages = apply_filters( $this->plugin_name . '_admin_pages', $this->admin_pages );
return (array)$admin_pages;
}
public function plugin_extension_boxes( $echo = false ) {
/**
* extension_boxes
* =============================================
* array (
* 'id' => 'box_id' : Enter unique your box id
* 'content' => 'html_content' : (required) Enter the html content to show inside the box
* 'css' => 'custom style' : custom style for the box container
* )
*
*/
$extension_boxes = apply_filters( $this->plugin_name . '_plugin_extension_boxes', array() );
$output = '';
if ( is_array( $extension_boxes ) && count( $extension_boxes ) > 0 ) {
foreach ( $extension_boxes as $box ) {
if ( ! isset( $box['id'] ) ) $box['id'] = '';
if ( ! isset( $box['css'] ) ) $box['css'] = '';
if ( ! isset( $box['content'] ) ) $box['content'] = '';
$output .= '
';
$output .= $box['content'];
$output .= '
';
}
}
if ( $echo )
echo $output;
else
return $output;
}
/*-----------------------------------------------------------------------------------*/
/* plugin_extension_start() */
/* Start of yellow box on right for pro fields
/*-----------------------------------------------------------------------------------*/
public function plugin_extension_start( $echo = true ) {
$output = '';
$output .= '
';
$output .= '
';
$output .= $this->plugin_extension_boxes( false );
$output .= '
';
$output .= '
';
$output .= '
';
$output = apply_filters( $this->plugin_name . '_plugin_extension_start', $output );
if ( $echo )
echo $output;
else
return $output;
}
/*-----------------------------------------------------------------------------------*/
/* plugin_extension_start() */
/* End of yellow box on right for pro fields
/*-----------------------------------------------------------------------------------*/
public function plugin_extension_end( $echo = true ) {
$output = '
';
$output .= '
';
$output = apply_filters( $this->plugin_name . '_plugin_extension_end', $output );
if ( $echo )
echo $output;
else
return $output;
}
/*-----------------------------------------------------------------------------------*/
/* upgrade_top_message() */
/* Show upgrade top message for pro fields
/*-----------------------------------------------------------------------------------*/
public function upgrade_top_message( $echo = false, $setting_id = '' ) {
$upgrade_top_message = sprintf( ''
. __( 'Advanced Settings - Upgrade to the
%s License to activate these settings.', 'a3_lazy_load' )
. '
'
, apply_filters( $this->plugin_name . '_' . $setting_id . '_pro_plugin_page_url', apply_filters( $this->plugin_name . '_pro_plugin_page_url', $this->pro_plugin_page_url ) )
, apply_filters( $this->plugin_name . '_' . $setting_id . '_pro_version_name', apply_filters( $this->plugin_name . '_pro_version_name', __( 'Pro Version', 'a3_lazy_load' ) ) )
);
$upgrade_top_message = apply_filters( $this->plugin_name . '_upgrade_top_message', $upgrade_top_message );
if ( $echo ) echo $upgrade_top_message;
else return $upgrade_top_message;
}
/*-----------------------------------------------------------------------------------*/
/* pro_fields_before() */
/* Start of yellow box on right for pro fields
/*-----------------------------------------------------------------------------------*/
public function pro_fields_before( $echo = true ) {
echo apply_filters( $this->plugin_name . '_pro_fields_before', ''. $this->upgrade_top_message() );
}
/*-----------------------------------------------------------------------------------*/
/* pro_fields_after() */
/* End of yellow border for pro fields
/*-----------------------------------------------------------------------------------*/
public function pro_fields_after( $echo = true ) {
echo apply_filters( $this->plugin_name . '_pro_fields_after', '
' );
}
/*-----------------------------------------------------------------------------------*/
/* blue_message_box() */
/* Blue Message Box
/*-----------------------------------------------------------------------------------*/
public function blue_message_box( $message = '', $width = '600px' ) {
$message = '';
$message = apply_filters( $this->plugin_name . '_blue_message_box', $message );
return $message;
}
}
?>