Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 107
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 234
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 235
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 236
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 237
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 238
Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 239
course_post_type;
$args = array(
'hierarchical' => false,
'show_ui' => false,
'show_in_nav_menus' => false,
'query_var' => is_admin(),
'rewrite' => false,
'public' => false,
);
register_taxonomy( self::TAXONOMY_NAME, $course_post_type, $args );
}
public function add_course_featured_to_settings( $settings ) {
/**
* Only administrator role can set course as featured.
*/
if ( current_user_can( 'administrator' ) ) {
$course_id = get_the_ID();
$option_is_set = false;
if ( has_term( 'featured', self::TAXONOMY_NAME, $course_id ) ) {
$option_is_set = true;
}
$settings['general']['fields']['course_featured'] = array(
'type' => 'toggle_switch',
'label' => __( 'Featured Course ?', 'edumall-addons' ),
'options' => array(
array(
'checked' => $option_is_set,
'value' => '1',
'hint' => __( 'Make This Course as Featured Course.', 'edumall-addons' ),
),
),
);
}
return $settings;
}
public function save_meta_featured( $post_ID, $post ) {
/**
* Only administrator role can set course as featured.
*/
if ( ! current_user_can( 'administrator' ) ) {
return;
}
$is_featured = isset( $_POST['course_featured'] ) && 'on' === $_POST['course_featured'] ? true : false;
if ( $is_featured ) {
wp_set_post_terms( $post_ID, array( 'featured' ), self::TAXONOMY_NAME, true );
} else {
$tags = wp_get_post_terms( $post_ID, self::TAXONOMY_NAME );
$tags_to_delete = array( 'featured' );
$tags_to_keep = array();
foreach ( $tags as $t ) {
if ( ! in_array( $t->name, $tags_to_delete ) ) {
$tags_to_keep[] = $t->name;
}
}
wp_set_post_terms( $post_ID, $tags_to_keep, self::TAXONOMY_NAME, false );
}
}
}
Course_Visibility::instance()->initialize();