Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/herald/core/admin/metaboxe...
File: page.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Load page metaboxes
[3] Fix | Delete
*
[4] Fix | Delete
* Callback function for page metaboxes load
[5] Fix | Delete
*
[6] Fix | Delete
* @since 1.0
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
if ( !function_exists( 'herald_load_page_metaboxes' ) ) :
[10] Fix | Delete
function herald_load_page_metaboxes() {
[11] Fix | Delete
[12] Fix | Delete
/* Layout metabox */
[13] Fix | Delete
add_meta_box(
[14] Fix | Delete
'herald_page_layout',
[15] Fix | Delete
esc_html__( 'Page Layout', 'herald' ),
[16] Fix | Delete
'herald_page_layout_metabox',
[17] Fix | Delete
'page',
[18] Fix | Delete
'side',
[19] Fix | Delete
'default'
[20] Fix | Delete
);
[21] Fix | Delete
[22] Fix | Delete
/* Sidebar metabox */
[23] Fix | Delete
add_meta_box(
[24] Fix | Delete
'herald_sidebar',
[25] Fix | Delete
esc_html__( 'Sidebar', 'herald' ),
[26] Fix | Delete
'herald_sidebar_metabox',
[27] Fix | Delete
'page',
[28] Fix | Delete
'side',
[29] Fix | Delete
'default'
[30] Fix | Delete
);
[31] Fix | Delete
[32] Fix | Delete
/* Authors template metabox */
[33] Fix | Delete
add_meta_box(
[34] Fix | Delete
'herald_author_options',
[35] Fix | Delete
esc_html__('Authors', 'herald'),
[36] Fix | Delete
'herald_author_options_metabox',
[37] Fix | Delete
'page',
[38] Fix | Delete
'side',
[39] Fix | Delete
'default'
[40] Fix | Delete
) ;
[41] Fix | Delete
[42] Fix | Delete
/* Modules metabox */
[43] Fix | Delete
add_meta_box(
[44] Fix | Delete
'herald_modules',
[45] Fix | Delete
esc_html__( 'Modules', 'herald' ),
[46] Fix | Delete
'herald_modules_metabox',
[47] Fix | Delete
'page',
[48] Fix | Delete
'normal',
[49] Fix | Delete
'high'
[50] Fix | Delete
);
[51] Fix | Delete
[52] Fix | Delete
/* Pagination metabox */
[53] Fix | Delete
add_meta_box(
[54] Fix | Delete
'herald_pagination',
[55] Fix | Delete
esc_html__( 'Pagination', 'herald' ),
[56] Fix | Delete
'herald_pagination_metabox',
[57] Fix | Delete
'page',
[58] Fix | Delete
'normal',
[59] Fix | Delete
'high'
[60] Fix | Delete
);
[61] Fix | Delete
[62] Fix | Delete
}
[63] Fix | Delete
endif;
[64] Fix | Delete
[65] Fix | Delete
[66] Fix | Delete
/**
[67] Fix | Delete
* Save page meta
[68] Fix | Delete
*
[69] Fix | Delete
* Callback function to save page meta data
[70] Fix | Delete
*
[71] Fix | Delete
* @since 1.0
[72] Fix | Delete
*/
[73] Fix | Delete
[74] Fix | Delete
if ( !function_exists( 'herald_save_page_metaboxes' ) ) :
[75] Fix | Delete
function herald_save_page_metaboxes( $post_id, $post ) {
[76] Fix | Delete
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
[77] Fix | Delete
return;
[78] Fix | Delete
[79] Fix | Delete
if ( isset( $_POST['herald_page_nonce'] ) ) {
[80] Fix | Delete
if ( !wp_verify_nonce( $_POST['herald_page_nonce'], __FILE__ ) )
[81] Fix | Delete
return;
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
if ( $post->post_type == 'page' && isset( $_POST['herald'] ) ) {
[85] Fix | Delete
$post_type = get_post_type_object( $post->post_type );
[86] Fix | Delete
if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
[87] Fix | Delete
return $post_id;
[88] Fix | Delete
[89] Fix | Delete
$herald_meta = array();
[90] Fix | Delete
[91] Fix | Delete
if( isset( $_POST['herald']['use_sidebar'] ) && $_POST['herald']['use_sidebar'] != 'inherit' ){
[92] Fix | Delete
$herald_meta['use_sidebar'] = $_POST['herald']['use_sidebar'];
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
if( isset( $_POST['herald']['sidebar'] ) && $_POST['herald']['sidebar'] != 'inherit' ){
[96] Fix | Delete
$herald_meta['sidebar'] = $_POST['herald']['sidebar'];
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
if( isset( $_POST['herald']['sticky_sidebar'] ) && $_POST['herald']['sticky_sidebar'] != 'inherit' ){
[100] Fix | Delete
$herald_meta['sticky_sidebar'] = $_POST['herald']['sticky_sidebar'];
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
if( isset( $_POST['herald']['layout'] ) && $_POST['herald']['layout'] != 'inherit' ){
[104] Fix | Delete
$herald_meta['layout'] = $_POST['herald']['layout'];
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
if( isset( $_POST['herald']['pag'] ) && $_POST['herald']['pag'] != 'none' ){
[108] Fix | Delete
$herald_meta['pag'] = $_POST['herald']['pag'];
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
if ( isset( $_POST['herald']['sections'] ) ) {
[112] Fix | Delete
$herald_meta['sections'] = array_values( $_POST['herald']['sections'] );
[113] Fix | Delete
foreach($herald_meta['sections'] as $i => $section ){
[114] Fix | Delete
if(!empty($section['modules'])){
[115] Fix | Delete
foreach( $section['modules'] as $j => $module ){
[116] Fix | Delete
if ( isset( $module['manual'] ) && !empty( $module['manual'] ) ) {
[117] Fix | Delete
$section['modules'][$j]['manual'] = array_map( 'absint', explode( ",", $module['manual'] ) );
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
if ( isset( $module['author'] ) && !empty( $module['author'] ) ) {
[121] Fix | Delete
[122] Fix | Delete
$section['modules'][$j]['author'] = herald_get_authors_id_by_username($module['author']);
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
if( !empty( $module['exclude_by_id'] ) ){
[126] Fix | Delete
$section['modules'][$j]['exclude_by_id'] = array_map('absint', explode(',', $module['exclude_by_id']));
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
if ( isset( $module['tag'] ) && !empty( $module['tag'] ) ) {
[130] Fix | Delete
$tax = $module['type'] == 'woocommerce' ? 'product_tag' : 'post_tag';
[131] Fix | Delete
$section['modules'][$j]['tag'] = herald_get_tax_term_slug_by_name( $module['tag'], $tax);
[132] Fix | Delete
}
[133] Fix | Delete
[134] Fix | Delete
if( !empty( $module['tax'] ) ) {
[135] Fix | Delete
[136] Fix | Delete
$taxonomies = array();
[137] Fix | Delete
foreach( $module['tax'] as $k => $tax ){
[138] Fix | Delete
[139] Fix | Delete
if(!empty($tax)){
[140] Fix | Delete
[141] Fix | Delete
if( is_array($tax) ){
[142] Fix | Delete
$taxonomies[$k] = $tax;
[143] Fix | Delete
} else {
[144] Fix | Delete
$taxonomies[$k] = herald_get_tax_term_id_by_name( $tax, $k);
[145] Fix | Delete
[146] Fix | Delete
}
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
}
[150] Fix | Delete
$section['modules'][$j]['tax'] = $taxonomies;
[151] Fix | Delete
}
[152] Fix | Delete
}
[153] Fix | Delete
[154] Fix | Delete
$herald_meta['sections'][$i]['modules'] = array_values($section['modules']);
[155] Fix | Delete
}
[156] Fix | Delete
}
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
if ( isset( $_POST['herald']['authors'] ) ) {
[160] Fix | Delete
$herald_meta['authors']['orderby'] = !empty( $_POST['herald']['authors']['orderby'] ) ? $_POST['herald']['authors']['orderby'] : 0;
[161] Fix | Delete
$herald_meta['authors']['order'] = !empty( $_POST['herald']['authors']['order'] ) ? $_POST['herald']['authors']['order'] : 'DESC';
[162] Fix | Delete
$herald_meta['authors']['exclude'] = !empty( $_POST['herald']['authors']['exclude'] ) ? array_map('absint', explode(',', $_POST['herald']['authors']['exclude'])) : '';
[163] Fix | Delete
$herald_meta['authors']['roles'] = !empty( $_POST['herald']['authors']['roles'] ) ? $_POST['herald']['authors']['roles'] : array();
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
if(!empty($herald_meta)){
[167] Fix | Delete
update_post_meta( $post_id, '_herald_meta', $herald_meta );
[168] Fix | Delete
} else {
[169] Fix | Delete
delete_post_meta( $post_id, '_herald_meta');
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
}
[173] Fix | Delete
}
[174] Fix | Delete
endif;
[175] Fix | Delete
[176] Fix | Delete
/**
[177] Fix | Delete
* Layout metabox
[178] Fix | Delete
*
[179] Fix | Delete
* Callback function to create layout metabox
[180] Fix | Delete
*
[181] Fix | Delete
* @since 1.0
[182] Fix | Delete
*/
[183] Fix | Delete
[184] Fix | Delete
if ( !function_exists( 'herald_page_layout_metabox' ) ) :
[185] Fix | Delete
function herald_page_layout_metabox( $object, $box ) {
[186] Fix | Delete
[187] Fix | Delete
$meta = herald_get_page_meta( $object->ID );
[188] Fix | Delete
$layouts = herald_get_page_layouts( true );
[189] Fix | Delete
?>
[190] Fix | Delete
<ul class="herald-img-select-wrap">
[191] Fix | Delete
<?php foreach ( $layouts as $id => $layout ): ?>
[192] Fix | Delete
<li>
[193] Fix | Delete
<?php $selected_class = $id == $meta['layout'] ? ' selected': ''; ?>
[194] Fix | Delete
<img src="<?php echo esc_url($layout['img']); ?>" title="<?php echo esc_attr($layout['title']); ?>" class="herald-img-select<?php echo esc_attr($selected_class); ?>">
[195] Fix | Delete
<span><?php echo esc_html( $layout['title'] ); ?></span>
[196] Fix | Delete
<input type="radio" class="herald-hidden" name="herald[layout]" value="<?php echo esc_attr($id); ?>" <?php checked( $id, $meta['layout'] );?>/> </label>
[197] Fix | Delete
</li>
[198] Fix | Delete
<?php endforeach; ?>
[199] Fix | Delete
</ul>
[200] Fix | Delete
[201] Fix | Delete
<p class="description"><?php esc_html_e( 'Choose a layout', 'herald' ); ?></p>
[202] Fix | Delete
[203] Fix | Delete
<?php
[204] Fix | Delete
}
[205] Fix | Delete
endif;
[206] Fix | Delete
[207] Fix | Delete
[208] Fix | Delete
/**
[209] Fix | Delete
* Pagination metabox
[210] Fix | Delete
*
[211] Fix | Delete
* Callback function to create pagination metabox
[212] Fix | Delete
*
[213] Fix | Delete
* @since 1.0
[214] Fix | Delete
*/
[215] Fix | Delete
[216] Fix | Delete
if ( !function_exists( 'herald_pagination_metabox' ) ) :
[217] Fix | Delete
function herald_pagination_metabox( $object, $box ) {
[218] Fix | Delete
[219] Fix | Delete
$meta = herald_get_page_meta( $object->ID );
[220] Fix | Delete
$layouts = herald_get_pagination_layouts( false, true );
[221] Fix | Delete
?>
[222] Fix | Delete
<ul class="herald-img-select-wrap">
[223] Fix | Delete
<?php foreach ( $layouts as $id => $layout ): ?>
[224] Fix | Delete
<li>
[225] Fix | Delete
<?php $selected_class = $id == $meta['pag'] ? ' selected': ''; ?>
[226] Fix | Delete
<img src="<?php echo esc_url($layout['img']); ?>" title="<?php echo esc_attr($layout['title']); ?>" class="herald-img-select<?php echo esc_attr($selected_class); ?>">
[227] Fix | Delete
<span><?php echo esc_html( $layout['title'] ); ?></span>
[228] Fix | Delete
<input type="radio" class="herald-hidden" name="herald[pag]" value="<?php echo esc_attr($id); ?>" <?php checked( $id, $meta['pag'] );?>/> </label>
[229] Fix | Delete
</li>
[230] Fix | Delete
<?php endforeach; ?>
[231] Fix | Delete
</ul>
[232] Fix | Delete
[233] Fix | Delete
<p class="description"><?php esc_html_e( 'Note: Pagination will be applied to the last post module on the page', 'herald' ); ?></p>
[234] Fix | Delete
[235] Fix | Delete
<?php
[236] Fix | Delete
}
[237] Fix | Delete
endif;
[238] Fix | Delete
[239] Fix | Delete
/**
[240] Fix | Delete
* Module generator metabox
[241] Fix | Delete
*
[242] Fix | Delete
* Callback function to create modules metabox
[243] Fix | Delete
*
[244] Fix | Delete
* @since 1.0
[245] Fix | Delete
*/
[246] Fix | Delete
[247] Fix | Delete
if ( !function_exists( 'herald_modules_metabox' ) ) :
[248] Fix | Delete
function herald_modules_metabox( $object, $box ) {
[249] Fix | Delete
[250] Fix | Delete
$meta = herald_get_page_meta( $object->ID );
[251] Fix | Delete
[252] Fix | Delete
//print_r($meta);
[253] Fix | Delete
[254] Fix | Delete
$default = array(
[255] Fix | Delete
'modules' => array(),
[256] Fix | Delete
'use_sidebar' => 'right',
[257] Fix | Delete
'sidebar' => 'herald_default_sidebar',
[258] Fix | Delete
'sticky_sidebar' => 'herald_default_sticky_sidebar',
[259] Fix | Delete
'css_class' => ''
[260] Fix | Delete
);
[261] Fix | Delete
[262] Fix | Delete
$module_defaults = herald_get_module_defaults();
[263] Fix | Delete
[264] Fix | Delete
[265] Fix | Delete
$options = array(
[266] Fix | Delete
'use_sidebar' => herald_get_sidebar_layouts(),
[267] Fix | Delete
'sidebars' => herald_get_sidebars_list(),
[268] Fix | Delete
'module_options' => herald_get_module_options()
[269] Fix | Delete
);
[270] Fix | Delete
[271] Fix | Delete
?>
[272] Fix | Delete
[273] Fix | Delete
<div id="herald-sections">
[274] Fix | Delete
<?php if(!empty($meta['sections'])) : ?>
[275] Fix | Delete
<?php foreach($meta['sections'] as $i => $section) : $section = herald_parse_args( $section, $default ); ?>
[276] Fix | Delete
<?php herald_generate_section( $section, $options, $i ); ?>
[277] Fix | Delete
<?php endforeach; ?>
[278] Fix | Delete
<?php endif; ?>
[279] Fix | Delete
</div>
[280] Fix | Delete
[281] Fix | Delete
<p><a href="javascript:void(0);" class="herald-add-section button-primary"><?php esc_html_e( 'Create new section', 'herald' ); ?></a></p>
[282] Fix | Delete
[283] Fix | Delete
<div id="herald-section-clone">
[284] Fix | Delete
<?php herald_generate_section( $default, $options ); ?>
[285] Fix | Delete
</div>
[286] Fix | Delete
[287] Fix | Delete
<div id="herald-module-clone">
[288] Fix | Delete
<?php foreach( $module_defaults as $type => $module ): ?>
[289] Fix | Delete
<div class="<?php echo esc_attr($type); ?>">
[290] Fix | Delete
<?php herald_generate_module( $module, $options['module_options'][$type]); ?>
[291] Fix | Delete
</div>
[292] Fix | Delete
<?php endforeach; ?>
[293] Fix | Delete
</div>
[294] Fix | Delete
[295] Fix | Delete
<div id="herald-sections-count" data-count="<?php echo count($meta['sections']); ?>"></div>
[296] Fix | Delete
[297] Fix | Delete
<?php
[298] Fix | Delete
}
[299] Fix | Delete
endif;
[300] Fix | Delete
[301] Fix | Delete
[302] Fix | Delete
/**
[303] Fix | Delete
* Generate section
[304] Fix | Delete
*
[305] Fix | Delete
* Generate section field inside modules generator
[306] Fix | Delete
*
[307] Fix | Delete
* @param $section Data array for current section
[308] Fix | Delete
* @param $options An array of section options
[309] Fix | Delete
* @param $i id of a current section, if false then create an empty section
[310] Fix | Delete
* @since 1.0
[311] Fix | Delete
*/
[312] Fix | Delete
[313] Fix | Delete
if ( !function_exists( 'herald_generate_section' ) ) :
[314] Fix | Delete
function herald_generate_section( $section, $options, $i = false ) {
[315] Fix | Delete
extract( $options );
[316] Fix | Delete
$name_prefix = ( $i === false ) ? '' : 'herald[sections]['.$i.']';
[317] Fix | Delete
$edit = ( $i === false ) ? '' : 'edit';
[318] Fix | Delete
$section_class = ( $i === false ) ? '' : 'herald-section-'.$i;
[319] Fix | Delete
$section_num = ( $i === false ) ? '' : $i ;
[320] Fix | Delete
//print_r($section);
[321] Fix | Delete
?>
[322] Fix | Delete
<div class="herald-section <?php echo esc_attr($section_class); ?>" data-section="<?php echo esc_attr($section_num); ?>">
[323] Fix | Delete
[324] Fix | Delete
<div class="herald-modules">
[325] Fix | Delete
<?php if(!empty( $section['modules'] ) ): ?>
[326] Fix | Delete
<?php foreach($section['modules'] as $j => $module ) : $module = herald_parse_args( $module, herald_get_module_defaults( $module['type'] ) ); ?>
[327] Fix | Delete
<?php herald_generate_module( $module, $module_options[$module['type']], $i, $j ); ?>
[328] Fix | Delete
<?php endforeach; ?>
[329] Fix | Delete
<?php endif; ?>
[330] Fix | Delete
</div>
[331] Fix | Delete
[332] Fix | Delete
<div class="herald-modules-count" data-count="<?php echo esc_attr(count($section['modules'])); ?>"></div>
[333] Fix | Delete
[334] Fix | Delete
[335] Fix | Delete
<div class="section-bottom">
[336] Fix | Delete
<div class="left">
[337] Fix | Delete
<?php $module_data = herald_get_module_defaults(); ?>
[338] Fix | Delete
<?php foreach( $module_data as $key => $mod ) : ?>
[339] Fix | Delete
<a href="javascript:void(0);" class="herald-add-module button-secondary" data-type="<?php echo esc_attr($mod['type']); ?>"><?php echo '+ '.$mod['type_name']. ' ' .esc_html__( 'Module', 'herald'); ?></a>
[340] Fix | Delete
<?php endforeach; ?>
[341] Fix | Delete
</div>
[342] Fix | Delete
<div class="right">
[343] Fix | Delete
<span><?php esc_html_e( 'Sidebar', 'herald' ); ?> (<span class="herald-sidebar"><?php echo esc_html( $section['use_sidebar'] ); ?></span>)</span>
[344] Fix | Delete
<a href="javascript:void(0);" class="herald-edit-section button-secondary"><?php esc_html_e( 'Edit', 'herald' ); ?></a>
[345] Fix | Delete
<a href="javascript:void(0);" class="herald-remove-section button-secondary"><?php esc_html_e( 'Remove', 'herald' ); ?></a>
[346] Fix | Delete
</div>
[347] Fix | Delete
</div>
[348] Fix | Delete
[349] Fix | Delete
[350] Fix | Delete
<div class="herald-section-form <?php echo esc_attr($edit); ?>">
[351] Fix | Delete
[352] Fix | Delete
<div class="herald-opt">
[353] Fix | Delete
<div class="herald-opt-title">
[354] Fix | Delete
<?php esc_html_e( 'Display sidebar', 'herald' ); ?>:
[355] Fix | Delete
</div>
[356] Fix | Delete
<div class="herald-opt-content">
[357] Fix | Delete
<ul class="herald-img-select-wrap">
[358] Fix | Delete
<?php foreach ( $use_sidebar as $id => $layout ): ?>
[359] Fix | Delete
<li>
[360] Fix | Delete
<?php $selected_class = herald_compare( $id, $section['use_sidebar'] ) ? ' selected': ''; ?>
[361] Fix | Delete
<img src="<?php echo esc_url($layout['img']); ?>" title="<?php echo esc_attr($layout['title']); ?>" class="herald-img-select<?php echo esc_attr($selected_class); ?>">
[362] Fix | Delete
<br/><span><?php echo esc_html( $layout['title'] ); ?></span>
[363] Fix | Delete
<input type="radio" class="herald-hidden herald-count-me sec-sidebar" name="<?php echo esc_attr($name_prefix); ?>[use_sidebar]" value="<?php echo esc_attr($id); ?>" <?php checked( $id, $section['use_sidebar'] );?>/>
[364] Fix | Delete
</li>
[365] Fix | Delete
<?php endforeach; ?>
[366] Fix | Delete
</ul>
[367] Fix | Delete
<small class="howto"><?php esc_html_e( 'Choose a sidebar layout', 'herald' ); ?></small>
[368] Fix | Delete
</div>
[369] Fix | Delete
</div>
[370] Fix | Delete
[371] Fix | Delete
<div class="herald-opt">
[372] Fix | Delete
<div class="herald-opt-title">
[373] Fix | Delete
<?php esc_html_e( 'Standard sidebar', 'herald' ); ?>:
[374] Fix | Delete
</div>
[375] Fix | Delete
<div class="herald-opt-content">
[376] Fix | Delete
<select name="<?php echo esc_attr($name_prefix); ?>[sidebar]" class="herald-count-me herald-opt-select">
[377] Fix | Delete
<?php foreach ( $sidebars as $id => $name ): ?>
[378] Fix | Delete
<option class="herald-count-me" value="<?php echo esc_attr($id); ?>" <?php selected( $id, $section['sidebar'] );?>><?php echo esc_html( $name ); ?></option>
[379] Fix | Delete
<?php endforeach; ?>
[380] Fix | Delete
</select>
[381] Fix | Delete
<small class="howto"><?php esc_html_e( 'Choose a standard sidebar', 'herald' ); ?></small>
[382] Fix | Delete
</div>
[383] Fix | Delete
</div>
[384] Fix | Delete
[385] Fix | Delete
<div class="herald-opt">
[386] Fix | Delete
<div class="herald-opt-title">
[387] Fix | Delete
<?php esc_html_e( 'Sticky sidebar', 'herald' ); ?>:
[388] Fix | Delete
</div>
[389] Fix | Delete
<div class="herald-opt-content">
[390] Fix | Delete
<select name="<?php echo esc_attr($name_prefix); ?>[sticky_sidebar]" class="herald-count-me herald-opt-select">
[391] Fix | Delete
<?php foreach ( $sidebars as $id => $name ): ?>
[392] Fix | Delete
<option class="herald-count-me" value="<?php echo esc_attr($id); ?>" <?php selected( $id, $section['sticky_sidebar'] );?>><?php echo esc_html( $name ); ?></option>
[393] Fix | Delete
<?php endforeach; ?>
[394] Fix | Delete
</select>
[395] Fix | Delete
<small class="howto"><?php esc_html_e( 'Choose a sticky sidebar', 'herald' ); ?></small>
[396] Fix | Delete
</div>
[397] Fix | Delete
</div>
[398] Fix | Delete
[399] Fix | Delete
<div class="herald-opt">
[400] Fix | Delete
<div class="herald-opt-title">
[401] Fix | Delete
<?php esc_html_e( 'Custom CSS class', 'herald' ); ?>:
[402] Fix | Delete
</div>
[403] Fix | Delete
<div class="herald-opt-content">
[404] Fix | Delete
<input class="herald-count-me" type="text" name="<?php echo esc_attr($name_prefix); ?>[css_class]" value="<?php echo esc_attr($section['css_class']);?>"/><br/>
[405] Fix | Delete
<small class="howto"><?php esc_html_e( 'Specify class name for a possibility to apply custom styling to this section using CSS (i.e. my-custom-section)', 'herald' ); ?></small>
[406] Fix | Delete
</div>
[407] Fix | Delete
</div>
[408] Fix | Delete
[409] Fix | Delete
</div>
[410] Fix | Delete
[411] Fix | Delete
</div>
[412] Fix | Delete
<?php
[413] Fix | Delete
}
[414] Fix | Delete
endif;
[415] Fix | Delete
[416] Fix | Delete
[417] Fix | Delete
/**
[418] Fix | Delete
* Generate module field
[419] Fix | Delete
*
[420] Fix | Delete
* @param $module Data array for current module
[421] Fix | Delete
* @param $options An array of module options
[422] Fix | Delete
* @param $i id of a current section
[423] Fix | Delete
* @param $j id of a current module
[424] Fix | Delete
* @since 1.0
[425] Fix | Delete
*/
[426] Fix | Delete
[427] Fix | Delete
if ( !function_exists( 'herald_generate_module' ) ) :
[428] Fix | Delete
function herald_generate_module( $module, $options, $i = false, $j = false ) {
[429] Fix | Delete
//print_r($module['type']);
[430] Fix | Delete
$name_prefix = ( $i === false ) ? '' : 'herald[sections]['.$i.'][modules]['.$j.']';
[431] Fix | Delete
$edit = ( $j === false ) ? '' : 'edit';
[432] Fix | Delete
$module_class = ( $j === false ) ? '' : 'herald-module-'.$j;
[433] Fix | Delete
$module_num = ( $j === false ) ? '' : $j;
[434] Fix | Delete
[435] Fix | Delete
$activate_hidden = $module['active'] ? 'herald-hidden' : '';
[436] Fix | Delete
$deactivate_hidden = $module['active'] ? '' : 'herald-hidden';
[437] Fix | Delete
[438] Fix | Delete
if( !$module['active'] ) {
[439] Fix | Delete
$module_class .= ' herald-module-disabled';
[440] Fix | Delete
}
[441] Fix | Delete
[442] Fix | Delete
[443] Fix | Delete
?>
[444] Fix | Delete
<div class="herald-module <?php echo esc_attr($module_class); ?>" data-module="<?php echo esc_attr($module_num); ?>">
[445] Fix | Delete
[446] Fix | Delete
<div class="left">
[447] Fix | Delete
<span class="herald-module-type">
[448] Fix | Delete
<?php echo esc_html( $module['type_name'] ); ?>
[449] Fix | Delete
<?php if(isset($module['columns']) && !in_array( $module['type'], array('woocommerce', 'authors', 'cats') ) ){
[450] Fix | Delete
$columns = herald_get_module_columns();
[451] Fix | Delete
echo '(<span class="herald-module-columns">'.$columns[$module['columns']]['title'].'</span>)';
[452] Fix | Delete
}
[453] Fix | Delete
?>
[454] Fix | Delete
</span>
[455] Fix | Delete
<span class="herald-module-title"><?php echo esc_html( $module['title'] ); ?></span>
[456] Fix | Delete
</div>
[457] Fix | Delete
[458] Fix | Delete
[459] Fix | Delete
[460] Fix | Delete
<div class="right">
[461] Fix | Delete
[462] Fix | Delete
<a href="javascript:void(0);" class="herald-edit-module"><?php esc_html_e( 'Edit', 'herald' ); ?></a> |
[463] Fix | Delete
<a href="javascript:void(0);" class="herald-deactivate-module"><span class="<?php echo esc_attr($deactivate_hidden);?>"><?php esc_html_e( 'Deactivate', 'herald' ); ?></span><span class="<?php echo esc_attr($activate_hidden);?>"><?php esc_html_e( 'Activate', 'herald' ); ?></span></a> |
[464] Fix | Delete
<a href="javascript:void(0);" class="herald-remove-module"><?php esc_html_e( 'Remove', 'herald' ); ?></a>
[465] Fix | Delete
</div>
[466] Fix | Delete
[467] Fix | Delete
<div class="herald-module-form <?php echo esc_attr($edit); ?>">
[468] Fix | Delete
<input class="herald-count-me" type="hidden" name="<?php echo esc_attr($name_prefix); ?>[type]" value="<?php echo esc_attr($module['type']); ?>"/>
[469] Fix | Delete
<input class="herald-module-deactivate" type="hidden" name="<?php echo esc_attr($name_prefix); ?>[active]" value="<?php echo esc_attr($module['active']); ?>"/>
[470] Fix | Delete
<?php $mod_type = isset($module['cpt']) ? 'cpt' : $module['type']; ?>
[471] Fix | Delete
<?php call_user_func( 'herald_generate_module_'.$mod_type, $module, $options, $name_prefix ); ?>
[472] Fix | Delete
[473] Fix | Delete
</div>
[474] Fix | Delete
[475] Fix | Delete
</div>
[476] Fix | Delete
[477] Fix | Delete
<?php
[478] Fix | Delete
}
[479] Fix | Delete
endif;
[480] Fix | Delete
[481] Fix | Delete
[482] Fix | Delete
/**
[483] Fix | Delete
* Generate posts module
[484] Fix | Delete
*
[485] Fix | Delete
* @param $module Data array for current module
[486] Fix | Delete
* @param $options An array of module options
[487] Fix | Delete
* @param $name_prefix id of a current module
[488] Fix | Delete
* @since 1.0
[489] Fix | Delete
*/
[490] Fix | Delete
[491] Fix | Delete
if ( !function_exists( 'herald_generate_module_posts' ) ) :
[492] Fix | Delete
function herald_generate_module_posts( $module, $options, $name_prefix ){
[493] Fix | Delete
[494] Fix | Delete
extract( $options ); ?>
[495] Fix | Delete
[496] Fix | Delete
<div class="herald-opt-tabs">
[497] Fix | Delete
<a href="javascript:void(0);" class="active"><?php esc_html_e( 'Appearance', 'herald' ); ?></a>
[498] Fix | Delete
<a href="javascript:void(0);"><?php esc_html_e( 'Selection', 'herald' ); ?></a>
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function