Как добавить бесплатное и платное видео в тему WordPress и WooCommerce?Php

Кемеровские программисты php общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Как добавить бесплатное и платное видео в тему WordPress и WooCommerce?

Сообщение Anonymous »


This is my code. I want to display the video watch link and video download link if the video is free. If the video is not free, I don't want to display the links. When the course is fully purchased, I want to display the video watch link and video download link. By the way, I am using WordPress and WooCommerce. Currently, my code doesn't display the links for free and non-free videos until the course is fully purchased.

My meta box code:

$courses_group_sessions = $courses_metaboxes->add_field( array( 'id' => $perfix.'course_sessions_group', 'type' => 'group', 'description' => __( 'Please add the sections or chapters of the lesson here.', $textdomain ), 'options' => array( 'group_title' => __( 'Main topics', $textdomain ), 'add_button' => __( 'Add topic', $textdomain ), 'remove_button' => __( 'Delete topic ', $textdomain ), 'sortable' => true, ), ) ); $courses_metaboxes->add_group_field( $courses_group_sessions, array( 'name' => esc_html__( 'Topic title', $textdomain ), 'id' => $perfix . 'part_title', 'type' => 'text', ) ); $courses_metaboxes->add_group_field($courses_group_sessions, array( 'name' => __('Is Free', $textdomain), 'id' => $perfix . 'is_free_lessons', 'type' => 'select', 'repeatable' => true, 'options' => array( 'free' => __('Free', $textdomain), 'not_free' => __('Not Free', $textdomain), ), 'text' => array( 'add_row_text' => 'Add video status', ), )); $courses_metaboxes->add_group_field($courses_group_sessions, array( 'name' => __('Sessions', $textdomain), 'id' => $perfix . 'menu_lessons', 'type' => 'text', 'repeatable' => true, 'text' => array( 'add_row_text' => 'Add sessions', ), 'desc' => __('add the titles of the sessions', $textdomain), )); $courses_metaboxes->add_group_field($courses_group_sessions, array( 'name' => __('Download links', $textdomain), 'id' => $perfix . 'link_lessons', 'type' => 'text_url', 'repeatable' => true, 'text' => array( 'add_row_text' => 'Add link', ), 'desc' => __('Important note: Please add the session links in the order specified in the above section. This means that if you enter a link for, lets say, session number 3, it will be considered for the title of session number 3', $textdomain), )); $courses_metaboxes->add_group_field($courses_group_sessions, array( 'name' => __('Video times', $textdomain), 'id' => $perfix . 'duration_time_lessons', 'type' => 'text_small', 'repeatable' => true, 'text' => array( 'add_row_text' => 'Add video times', ), 'desc' => __('Important note: Please add the video durations in the order specified in the above section. This means that if you set the duration for video number 3, it will be set for the title of video number 3', $textdomain), )); my course content code:

Course sessions Section [url=

Источник: https://stackoverflow.com/questions/780 ... erce-theme
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Php»