<div class="card-deck">
<div class="card">
<img class="card-img-top" src="..." alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
<div class="card">
<img class="card-img-top" src="..." alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
<div class="card">
<img class="card-img-top" src="..." alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
</div>
<div class="card-footer">
<small class="text-muted">Last updated 3 mins ago</small>
</div>
</div>
</div>
<?php /*
Plugin Name: My Mega-Sortcodes Plugin
Plugin URI: https://toster.ru/q/587001
Description: Плагин с моим шоткодами
Version: 1.2.3
Author: Dias Oral
*/
/* Подключение шоткод функций */
function first_shortcode_example(){
echo 'this is my shortcode motherfuckerfunction !';
}
add_shotcode('first_shortcode_example','first_shortcode_example');
?>
function es_event_types_taxonomy() {
$labels = array(
'name' => 'Тип',
'singular_name' => 'Тип мероприятия',
'menu_name' => 'Тип мероприятия',
'all_items' => 'Все типы мероприятий',
'parent_item' => 'Главный тип мероприятия',
'parent_item_colon' => 'Parent Item:',
'new_item_name' => 'Название нового типа мероприятий',
'add_new_item' => 'Добавить тип мероприятия',
'edit_item' => 'Редактировать тип',
'update_item' => 'Обновить тип',
'view_item' => 'Смотреть тип',
'separate_items_with_commas' => 'Добавление через запятую',
'add_or_remove_items' => 'Добавить или удалить тип мероприятий',
'choose_from_most_used' => 'Выбрать из наиболее популярных',
'popular_items' => 'Популярные типы',
'search_items' => 'Найти тип',
'not_found' => 'Тип не найден',
'no_terms' => 'Типов мероприятий нет.',
'items_list' => 'Список типов меропрриятий',
'items_list_navigation' => 'Items list navigation',
);
$es_type_capabilities = array(
'manage_terms' => 'manage_es_event_type',
'edit_terms' => 'edit_es_event_type',
'delete_terms' => 'delete_es_event_type',
'assign_terms' => 'assign_es_event_type',
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'show_in_quick_edit' => true,
'meta_box_cb' => true,
'capabilities' => $es_type_capabilities,
);
register_taxonomy( 'es_event_type', array( 'es_event' ), $args );
}
add_action( 'init', 'es_event_types_taxonomy', 0 );
/* В права роли соответственно добавил
'manage_es_event_type' => true,
'edit_es_event_type' => true,
'delete_es_event_type' => true,
'assign_es_event_type' => true,
*/
$images = get_attached_media('image',$post_id );
foreach ($images as $image) {?><img src="<?php echo $image->guid;?>" alt="" /><?php } ?>
if ( ! function_exists('agency_operations_post_type') ) {
function agency_operations_post_type() {
$operations_labels = array(
'name' => _x( 'Логи операций', 'agency_operations' ),
'singular_name' => _x( 'Логи операций', 'agency_operations' ),
'menu_name' => __( 'Логи операций', 'agency_operations' ),
'name_admin_bar' => __( 'Операция', 'agency_operations' ),
'archives' => __( 'Завершенные операции', 'agency_operations' ),
'attributes' => __( 'Аттрибуты операции', 'agency_operations' ),
'parent_item_colon' => __( 'Главная операция:', 'agency_operations' ),
'all_items' => __( 'Все Операции', 'agency_operations' ),
'add_new_item' => __( 'Добавить новую операцию', 'agency_operations' ),
'add_new' => __( 'Добавить новую операцию', 'agency_operations' ),
'new_item' => __( 'Новая операция', 'agency_operations' ),
'edit_item' => __( 'Редактировать Операцию', 'agency_operations' ),
'update_item' => __( 'Обновиить Операцию', 'agency_operations' ),
'view_item' => __( 'Просмотеть Операцию', 'agency_operations' ),
'view_items' => __( 'Просмотреть Операцию', 'agency_operations' ),
'search_items' => __( 'Найти Операцию', 'agency_operations' ),
'not_found' => __( 'Операций не проводилось', 'agency_operations' ),
'not_found_in_trash' => __( 'Корзина Операций пуста', 'agency_operations' ),
'featured_image' => __( 'Изображение Операции', 'agency_operations' ),
'set_featured_image' => __( 'Установить изображение Операции', 'agency_operations' ),
'remove_featured_image' => __( 'Удалить изображение Операции', 'agency_operations' ),
'use_featured_image' => __( 'Все изображения Операции', 'agency_operations' ),
'insert_into_item' => __( 'Добавить в Объект', 'agency_operations' ),
'uploaded_to_this_item' => __( 'Прикрепить к этой Операции', 'agency_operations' ),
'items_list' => __( 'Лист операций', 'agency_operations' ),
'items_list_navigation' => __( 'Лист операций', 'agency_operations' ),
'filter_items_list' => __( 'Фильтр Операций', 'agency_operations' ),
);
$operations_args = array(
'label' => __( 'Логи операций', 'agency_operations' ),
'description' => __( 'Логи операций.', 'agency_operations' ),
'labels' => $operations_labels,
'supports' => array( 'title', 'editor', 'revisions', 'thumbnail' ),
'taxonomies' => array( 'agency_operation_type'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-home',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'agency_operations', $operations_args );
}
add_action( 'init', 'agency_operations_post_type', 0 );
}
* Роль: Менеджер */
register_activation_hook( __FILE__, 'create_manager_role' );
function create_manager_role(){
$new_role = add_role('amanager', 'Менеджер', array(
'upload_files' => true,
'edit_posts' => true,
'edit_published_posts' => true,
'publish_posts' => true,
'read' => true,
'delete_posts' => false,
'delete_published_posts' => true,
'moderate_comments'=> true,
)
);
}
register_deactivation_hook( __FILE__, 'delete_manager_role' );
function delete_manager_role(){ remove_role( 'manager' ); }
/*ВАЖНО: Приведенный код - рабочий пример, требующий правок и доработок "под себя". */
function get_estate_photos($post_id){ ?>
<p>
<?php
$images = get_attached_media('image',$post_id );
foreach ($images as $image) { echo'<a class="fancybox" href="'.$image->guid.'" data-fancybox-group="images_'.$post_id.'" title=""><img class="estate_img" src="'.$image->guid.'" alt="" /></a>'; } ?>
</p>
<?php }