Я знаю, что вы можете использовать шорткод, чтобы выбрать, какие каналы отображать, но я бы предпочел не создавать отдельную страницу для каждого канала, а затем размещать на них ссылки. (есть более 10 каналов, один из которых регулярно добавляется и удаляется, поэтому вручную создать календарь для каждого отдельного канала просто невозможно).
Я добавил этот код в файл gce-script.js в плагине:
Код: Выделить всё
function changeFeeds(){
var values = jQuery("#gce-view-feed").val();
jQuery("#result").replaceWith(values);
}
jQuery("option").click(function(){
location.reload();
});
jQuery("select").change(changeFeeds);
changeFeeds();
Идентификаторы каналов определяются переменной PHP $feed_ids. Я думаю, что лучше всего редактировать переменную в этой строке кода в файле google-calendar-events.php:
Код: Выделить всё
//Check that any feeds have been added
if ( is_array( $options ) && ! empty( $options ) ) {
extract( shortcode_atts( array(
'id' => '',
'type' => 'grid',
'title' => null,
'max' => 0,
'order' => 'asc'
), $atts ) );
$no_feeds_exist = true;
$feed_ids = array();
if ( '' != $id ) {
//Break comma delimited list of feed ids into array
$feed_ids = explode( ',', str_replace( ' ', '', $id ) );
//Check each id is an integer, if not, remove it from the array
foreach ( $feed_ids as $key => $feed_id ) {
if ( 0 == absint( $feed_id ) )
unset( $feed_ids[$key] );
}
//If at least one of the feed ids entered exists, set no_feeds_exist to false
foreach ( $feed_ids as $feed_id ) {
if ( isset($options[$feed_id] ) )
$no_feeds_exist = false;
}
} else {
foreach ( $options as $feed ) {
$feed_ids[] = $feed['id'];
}
$no_feeds_exist = false;
}
Подробнее здесь: https://stackoverflow.com/questions/134 ... dar-events
Мобильная версия