Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php goto VRYAx; oy8KA: function update_diavouleusi_status($diav_id) { $post = get..
Decoded Output download
<?php
goto VRYAx;
oy8KA:
function update_diavouleusi_status($diav_id)
{
$post = get_post($diav_id);
$val = null;
if ($post->post_status == 'draft') {
$val = 'Draft';
} else {
$curr_time = current_time('Y-m-d H:i:s');
$start_date = date('Y-m-d H:i:s', strtotime(get_field('start_date', $diav_id)));
$end_date = date('Y-m-d H:i:s', strtotime(get_field('end_date', $diav_id)));
if ($start_date > $curr_time) {
$val = 'Scheduled';
} else {
if ($end_date > $curr_time) {
$val = 'Active';
} else {
$results = get_field('multiresults', $diav_id);
if ($results != null) {
$val = 'Completed';
} else {
$val = 'In processing';
}
}
}
error_log('Currtime: ' . $curr_time . ' StartDate:' . $start_date . ' strToTime: ' . strtotime(get_field('start_date', $diav_id)) . ' EndDate: ' . $end_date . ' Status: ' . $val);
}
update_field('status_hidden', $val, $diav_id);
return true;
}
goto GQldR;
lMN2H:
function set_diavouleusi_comment_status($diav_id, $status = 'closed')
{
$diav = get_post($diav_id);
set_post_comment_status($diav_id, $status);
update_articles_comment_status($diav_id, $status);
}
goto Nouv2;
v_sBd:
function diavouleusi_excerpt($excerpt)
{
if ('diavouleusi' !== get_post_type()) {
return $excerpt;
}
$post = get_post();
$extraExcerpt = '<div class="two_third tie-columns diav-content">';
$extraExcerpt .= '<span class="diav-author">' . get_diavouleusi_author($post->ID) . '</span>';
$extraExcerpt .= $excerpt;
$extraExcerpt .= get_diavouleusi_themes($post->ID);
$extraExcerpt .= get_diavouleusi_types($post->ID);
$extraExcerpt .= '</div><div class="one_third tie-columns last diav-fields">' . get_diavouleusi_intro_fields($post->ID, 1) . '</div>';
return $extraExcerpt;
}
goto X7v4v;
bD2Fo:
function get_diavouleusi_types($diav_id)
{
$val = '';
$terms = get_the_terms($diav_id, 'dlb_type');
if ($terms) {
$val = '<div class="post-badges dlb_type">';
foreach ($terms as $term) {
$val .= '<div class="post-badge">' . $term->name . '</div>';
}
$val .= '</div>';
}
return $val;
}
goto nNphe;
z4Mlp:
function get_diavouleusi_themes($diav_id)
{
$val = '';
$terms = get_the_terms($diav_id, 'dlb_theme');
if ($terms) {
$val = '<div class="post-badges">';
foreach ($terms as $term) {
$val .= '<div class="post-badge">' . $term->name . '</div>';
}
$val .= '</div>';
}
return $val;
}
goto bD2Fo;
US6aO:
function gnstl_show_ownpost_comments($clauses)
{
if (is_admin()) {
if (current_user_can('edit_others_posts')) {
return $clauses;
} else {
$user_id = get_current_user_id();
global $wpdb;
$clauses['join'] = ', ' . $wpdb->base_prefix . 'posts';
$clauses['where'] .= ' AND ' . $wpdb->base_prefix . 'comments.comment_post_ID = ' . $wpdb->base_prefix . 'posts.ID' . ' AND (' . $wpdb->base_prefix . 'posts.post_author = ' . $user_id . ' OR ' . $wpdb->base_prefix . 'comments.user_id = ' . $user_id . ')';
}
}
return $clauses;
}
goto l5bPI;
Rgqrj:
function update_all_diavouleuseis()
{
$timezone = new DateTimeZone('Europe/Athens');
error_log('Cron started at: ' . wp_date('Y-m-d H:i:s', null, $timezone));
$args = array('post_type' => 'diavouleusi', 'orderby' => 'post_date', 'order' => 'ASC', 'post_status' => 'publish');
$query = new WP_Query($args);
$diavouleuseis = $query->posts;
foreach ($diavouleuseis as $diav) {
if (!has_correct_comment_status($diav->ID)) {
$comment_status = calculate_comment_status($diav->ID);
update_articles_comment_status($diav->ID, $comment_status);
}
}
wp_reset_query();
error_log('Cron complete at: ' . wp_date('Y-m-d H:i:s', null, $timezone));
}
goto kYY1r;
VRYAx:
function say_hello()
{
$txt = 'Welcome to the eConsultation platform! <em>' . date_i18n('Y-m-d H:i:s', null) . '</em>';
return $txt;
}
goto TFErE;
GQldR:
function get_diavouleusi_status($diav_id)
{
return get_field('status_hidden', $diav_id);
}
goto suj3a;
Gp14y:
function display_diavouleusi_articles($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
print_diavouleusi_articles($attributes['id']);
}
goto LuWBx;
zmZdY:
function calculate_diav_post_status($diav_id)
{
$currTime = current_time('Y-m-d H:i:s');
$startDate = strtotime(get_field('start_date', $diav_id));
$newPostDate = date('Y-m-d H:i:s', $startDate);
$currPostStatus = get_post_status($diav_id);
$newPostStatus = $currPostStatus;
if ($currPostStatus == 'publish') {
if ($newPostDate > $currTime) {
$newPostStatus = 'future';
}
} else {
if ($currPostStatus == 'future') {
if ($newPostDate <= $currTime) {
$newPostStatus = 'publish';
}
}
}
return $newPostStatus;
}
goto oy8KA;
ZI4HF:
function display_diavouleusi_types($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
return get_diavouleusi_types($attributes['id']);
}
goto xaucG;
X7v4v:
add_filter('the_excerpt', 'diavouleusi_excerpt', 10, 1);
goto xM0gL;
g37CM:
function create_diavouleusi_articles($diav_id, $post_date, $post_status, $comment_status)
{
$num_articles = get_field('num_articles', $diav_id);
$tmpPost = get_post($diav_id);
$article_args = array('post_title' => ' ', 'post_type' => 'article', 'post_date' => $post_date, 'post_status' => $post_status, 'post_content' => '', 'post_author' => $tmpPost->post_author, 'comment_status' => $comment_status, 'tags_input' => get_diavouleusi_tagname($diav_id));
$article_index = '';
for ($i = 1; $i <= $num_articles; $i++) {
$article_index = sprintf('%02d', $i);
$article_args['post_title'] = $article_index . ' - ';
$tmpArticleID = wp_insert_post($article_args);
update_field('diavouleusi', $diav_id, $tmpArticleID);
}
}
goto Vtam5;
g6LeK:
function update_article_link_field($field)
{
$post = get_post();
$field['message'] = '<a class="button" href="' . get_articles_link($post->ID) . '" target="_blank"> </a>';
return $field;
}
goto rkZHE;
us28k:
function validate_end_date($valid, $value, $field, $input_name)
{
if ($valid !== true) {
return $valid;
}
$startDate = $_POST['acf']['field_60b724c57d1b9'];
$interval = date_diff(date_create($startDate), date_create($value));
if ($interval->format('%R%a') < 1) {
return __('The end date should be at least <b>1 day</b> after the start date.');
}
return $valid;
}
goto FPNnq;
MkiZF:
function get_diav_articles_bytag($diav_id, $trashed = false)
{
$tag_name = get_diavouleusi_tagname($diav_id);
$tag = get_term_by('name', $tag_name, 'post_tag');
error_log('Line 274 tag ' . $tag_name);
if (!$tag) {
return null;
}
$status = array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash');
if ($trashed == true) {
$status = 'trashed';
}
$args = array('post_type' => 'article', 'tag' => $tag_name, 'orderby' => 'post_title', 'order' => 'ASC', 'post_status' => $status, 'nopaging' => true);
$query = new WP_Query($args);
$posts = $query->posts;
error_log('Returned posts: ' . sizeof($posts));
foreach ($posts as $post) {
error_log('Post ID:: ' . $post->ID);
}
return $posts;
}
goto uFneL;
UZiYd:
function display_article_fields($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$diavouleusi = get_field('diavouleusi', $attributes['id']);
$link = get_post_permalink($diavouleusi);
return '<div class="diavouleusi-actions"><a href="' . $link . '" class="button btn"> </a></div>';
}
goto lcmYP;
eR9CG:
add_shortcode('diavouleusi_themes', 'display_diavouleusi_themes');
goto ZI4HF;
kYY1r:
function update_diavouleusi_starttime_event($diav_id)
{
error_log('SCHEDULED Task UpdateStartTime executed for ' . $diav_id . ' @ ' . current_time('Y-m-d H:i:s'));
if (has_started($diav_id)) {
update_diavouleusi_status($diav_id);
} else {
error_log('Ignoring event');
}
}
goto JkIJv;
FLCb6:
add_action('admin_head', 'genestial_css');
goto QHvnJ;
NJ6Au:
function gnstl_register_my_cpts()
{
$labels = array('name' => esc_html__('', 'jannahchild'), 'singular_name' => esc_html__('', 'jannahchild'), 'menu_name' => esc_html__('', 'jannahchild'), 'all_items' => esc_html__(' ', 'jannahchild'), 'add_new' => esc_html__(' ', 'jannahchild'), 'add_new_item' => esc_html__(' ', 'jannahchild'), 'edit_item' => esc_html__(' ', 'jannahchild'), 'new_item' => esc_html__(' ', 'jannahchild'), 'view_item' => esc_html__(' ', 'jannahchild'), 'view_items' => esc_html__(' ', 'jannahchild'), 'search_items' => esc_html__(' ', 'jannahchild'), 'not_found' => esc_html__(' ', 'jannahchild'), 'not_found_in_trash' => esc_html__(' ', 'jannahchild'), 'parent' => esc_html__('Parent Diavouleusi:', 'jannahchild'), 'featured_image' => esc_html__(' ', 'jannahchild'), 'set_featured_image' => esc_html__(' ', 'jannahchild'), 'remove_featured_image' => esc_html__(' ', 'jannahchild'), 'use_featured_image' => esc_html__(' ', 'jannahchild'), 'archives' => esc_html__(' ', 'jannahchild'), 'insert_into_item' => esc_html__('Insert into Diavouleusi', 'jannahchild'), 'uploaded_to_this_item' => esc_html__('Upload to this Diavouleusi', 'jannahchild'), 'filter_items_list' => esc_html__('Filter Diavouleuseis list', 'jannahchild'), 'items_list_navigation' => esc_html__('Diavouleuseis list navigation', 'jannahchild'), 'items_list' => esc_html__(' ', 'jannahchild'), 'attributes' => esc_html__('Diavouleuseis attributes', 'jannahchild'), 'name_admin_bar' => esc_html__('', 'jannahchild'), 'item_published' => esc_html__(' ', 'jannahchild'), 'item_published_privately' => esc_html__(' .', 'jannahchild'), 'item_reverted_to_draft' => esc_html__(' .', 'jannahchild'), 'item_scheduled' => esc_html__(' .', 'jannahchild'), 'item_updated' => esc_html__(' .', 'jannahchild'), 'parent_item_colon' => esc_html__('Parent Diavouleusi:', 'jannahchild'));
$args = array('label' => esc_html__('', 'jannahchild'), 'labels' => $labels, 'description' => '', 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_rest' => true, 'rest_base' => 'diavouleuseis', 'rest_controller_class' => 'WP_REST_Posts_Controller', 'rest_namespace' => 'wp/v2', 'has_archive' => 'diavouleuseis', 'show_in_menu' => true, 'show_in_nav_menus' => true, 'delete_with_user' => false, 'exclude_from_search' => false, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'can_export' => false, 'rewrite' => array('slug' => 'diavouleusi', 'with_front' => false), 'query_var' => true, 'menu_icon' => 'dashicons-format-chat', 'supports' => array('title', 'editor', 'excerpt', 'custom-fields', 'comments', 'revisions', 'author', 'post-formats'), 'taxonomies' => array('post_tag', 'dlb_theme'), 'show_in_graphql' => false);
register_post_type('diavouleusi', $args);
$labels = array('name' => esc_html__(' ', 'jannahchild'), 'singular_name' => esc_html__(' ', 'jannahchild'), 'menu_name' => esc_html__(' ', 'jannahchild'), 'all_items' => esc_html__(' ', 'jannahchild'), 'add_new' => esc_html__(' ', 'jannahchild'), 'add_new_item' => esc_html__(' ', 'jannahchild'), 'edit_item' => esc_html__(' ', 'jannahchild'), 'new_item' => esc_html__(' ', 'jannahchild'), 'view_item' => esc_html__(' ', 'jannahchild'), 'view_items' => esc_html__(' ', 'jannahchild'), 'search_items' => esc_html__(' ', 'jannahchild'), 'not_found' => esc_html__(' ', 'jannahchild'), 'not_found_in_trash' => esc_html__(' ', 'jannahchild'), 'parent' => esc_html__('Parent Article:', 'jannahchild'), 'featured_image' => esc_html__('Featured image for this Article', 'jannahchild'), 'set_featured_image' => esc_html__('Set featured image for this Article', 'jannahchild'), 'remove_featured_image' => esc_html__('Remove featured image for this Article', 'jannahchild'), 'use_featured_image' => esc_html__('Use as featured image for this Article', 'jannahchild'), 'archives' => esc_html__('Article archives', 'jannahchild'), 'insert_into_item' => esc_html__('Insert into Article', 'jannahchild'), 'uploaded_to_this_item' => esc_html__('Upload to this Article', 'jannahchild'), 'filter_items_list' => esc_html__('Filter Articles list', 'jannahchild'), 'items_list_navigation' => esc_html__('Articles list navigation', 'jannahchild'), 'items_list' => esc_html__('Articles list', 'jannahchild'), 'attributes' => esc_html__('Articles attributes', 'jannahchild'), 'name_admin_bar' => esc_html__(' ', 'jannahchild'), 'item_published' => esc_html__('Article published', 'jannahchild'), 'item_published_privately' => esc_html__('Article published privately.', 'jannahchild'), 'item_reverted_to_draft' => esc_html__('Article reverted to draft.', 'jannahchild'), 'item_scheduled' => esc_html__('Article scheduled', 'jannahchild'), 'item_updated' => esc_html__('Article updated.', 'jannahchild'), 'parent_item_colon' => esc_html__('Parent Article:', 'jannahchild'));
$args = array('label' => esc_html__(' ', 'jannahchild'), 'labels' => $labels, 'description' => '', 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_rest' => true, 'rest_base' => '', 'rest_controller_class' => 'WP_REST_Posts_Controller', 'rest_namespace' => 'wp/v2', 'has_archive' => false, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'delete_with_user' => false, 'exclude_from_search' => false, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => true, 'can_export' => false, 'rewrite' => array('slug' => 'article', 'with_front' => true), 'query_var' => true, 'menu_icon' => 'dashicons-media-document', 'supports' => array('title', 'editor', 'custom-fields', 'comments', 'revisions', 'author'), 'taxonomies' => array('post_tag'), 'show_in_graphql' => false);
register_post_type('article', $args);
}
goto PdbWc;
lcmYP:
add_shortcode('article_fields', 'display_article_fields');
goto vr5ff;
XeIbK:
function display_diavouleusi_results($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
if (get_diavouleusi_status($attributes['id']) != 'Completed') {
return;
}
$resources = get_field_object('multiresults', $attributes['id']);
if ($resources) {
echo '<div class="diavouleusi-results">';
echo '<h3 class="diav-heading">' . $resources['label'] . '</h3>';
if (have_rows($resources['name'])) {
echo '<ul>';
while (have_rows($resources['name'])) {
the_row();
$title = get_sub_field('title');
$file = get_sub_field('file');
$img = wp_get_attachment_image(get_sub_field('ID'));
$filetype = wp_check_filetype($file);
echo '<li><a href="' . $file . '" target="_blank" class="' . $filetype['ext'] . '">' . get_filetype_favicon($filetype['ext']) . ' ' . $title . '</a></li>';
}
echo '</ul>';
}
echo '</div>';
}
}
goto HjeJD;
Vtam5:
function update_articles_comment_status($diav_id, $comment_status)
{
$posts = get_diav_articles_bytag($diav_id);
if (!$posts) {
return;
}
if (!is_valid_comment_status($comment_status)) {
error_log('Invalid comment status: ' . $comment_status . '. Returning...');
return;
}
$update_args = array('ID' => 0, 'post_date' => '', 'post_status' => '', 'post_type' => 'article', 'post_title' => '', 'post_name' => '', 'post_modified' => '', 'post_content' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'comment_status' => $comment_status, 'ping_status' => '', 'post_password' => '', 'to_ping' => '', 'pinged' => '', 'post_parent' => '', 'menu_order' => '', 'post_mime_type' => '', 'guid' => '');
foreach ($posts as $post) {
$tmpPost = null;
$tmpPost = get_post($post->ID);
$update_args['ID'] = $post->ID;
$update_args['post_date'] = $tmpPost->post_date;
$update_args['post_status'] = $tmpPost->post_status;
$update_args['post_title'] = $tmpPost->post_title;
$update_args['post_name'] = $tmpPost->post_name;
$update_args['post_modified'] = $tmpPost->post_modified;
$update_args['post_content'] = $tmpPost->post_content;
$update_args['post_content_filtered'] = $tmpPost->post_content_filtered;
$update_args['post_excerpt'] = $tmpPost->post_excerpt;
$update_args['ping_status'] = $tmpPost->ping_status;
$update_args['post_password'] = $tmpPost->post_password;
$update_args['to_ping'] = $tmpPost->to_ping;
$update_args['pinged'] = $tmpPost->pinged;
$update_args['post_parent'] = $tmpPost->post_parent;
$update_args['menu_order'] = $tmpPost->menu_order;
$update_args['post_mime_type'] = $tmpPost->post_mime_type;
$update_args['guid'] = $tmpPost->guid;
$tmp = wp_insert_post($update_args);
}
}
goto YCkWN;
tCYtg:
function display_articles_related($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$diavouleusi = get_field('diavouleusi', $attributes['id']);
print_diavouleusi_articles($diavouleusi, false);
}
goto ckDZM;
Z2Lp0:
function update_diavouleusi($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('In update_diavouleusi');
if (defined('REST_REQUEST') && REST_REQUEST) {
return;
}
if (wp_is_post_revision($post_id) || wp_is_post_autosave($post_id)) {
return;
}
$tag_name = get_diavouleusi_tagname($post_id);
$tag_exists = term_exists($tag_name, 'post_tag');
$tag_changed = true;
if (!$tag_exists) {
$tmp = wp_insert_term($tag_name, 'post_tag');
if ($tmp) {
error_log('TAG CREATED: ' . $tag_name . ' POST id: ' . $post_id);
}
} else {
$posttags = get_the_tags($post_id);
if ($posttags) {
foreach ($posttags as $tag) {
error_log('Tag: ' . $tag->name);
if ($tag->name == $tag_name) {
$tag_changed = false;
break;
}
}
}
}
error_log('TAG CHANGE: ' . $tag_changed);
$currPostDate = get_the_date('Y-m-d H:i:s', $post_id);
$startDate = strtotime(get_field('start_date', $post_id));
$newPostDate = date('Y-m-d H:i:s', $startDate);
$start_date_changed = $newPostDate != $currPostDate;
$currPostStatus = get_post_status($post_id);
$newPostStatus = calculate_diav_post_status($post_id);
$status_changed = $newPostStatus != $currPostStatus;
$tmpPost = get_post($post_id);
$currCommentStatus = $tmpPost->comment_status;
$newCommentStatus = calculate_comment_status($post_id);
$comments_changed = $newCommentStatus != $currCommentStatus;
if ($comments_changed) {
error_log('Comment status changed to ' . $newCommentStatus);
}
if ($start_date_changed || $status_changed || $comments_changed || $tag_changed) {
$update_args = array('ID' => $post_id, 'post_date' => $newPostDate, 'post_date_gmt' => gmdate('Y-m-d H:i:s', $startDate), 'comment_status' => $newCommentStatus, 'post_status' => $newPostStatus, 'tags_input' => $tag_name);
remove_action('acf/save_post', 'build_diavouleusi');
wp_update_post($update_args, false, true);
add_action('acf/save_post', 'build_diavouleusi');
}
update_diavouleusi_status($post_id);
$articlesUpdated = update_diav_articles($post_id, $newPostDate, $newPostStatus, $newCommentStatus);
if ($articlesUpdated == 0) {
create_diavouleusi_articles($post_id, $newPostDate, $newPostStatus, $newCommentStatus);
}
}
goto Jvdum;
QHvnJ:
function plugin_dependencies_activate()
{
if (!is_plugin_active('advanced-custom-fields/acf.php') and current_user_can('activate_plugins')) {
wp_die('Sorry, but this plugin requires the plugins "Custom Post Type UI" and "Advanced Custom Fields" to be installed and active. <br><a href="' . admin_url('plugins.php') . '">« Return to Plugins</a>');
}
}
goto ZpOt9;
YCYlT:
add_action('schedule_diavouleusi_end', 'update_diavouleusi_endtime_event', 10, 3);
goto NJ6Au;
uOs8r:
function get_diavouleusi_comment_count($diav_id)
{
$total = 0;
$total = get_comments_number($diav_id);
$articles = get_diav_articles_bytag($diav_id);
foreach ($articles as $article) {
$total = $total + get_comments_number($article->ID);
}
return $total;
}
goto uA183;
ESXwZ:
function filter_own_diavouleuseis($args, $field, $post_id)
{
$user_id = get_current_user_id();
if (current_user_can('edit_others_posts')) {
return $args;
}
$args = array('author' => $user_id, 'post_type' => 'diavouleusi');
return $args;
}
goto xQzbi;
HjeJD:
add_shortcode('diavouleusi_results', 'display_diavouleusi_results');
goto UZiYd;
qz2s1:
function generate_comments_xls($diav_id)
{
if (!$diav_id) {
return null;
}
$comments = get_diavouleusi_comments($diav_id);
if (!$comments) {
return -1;
}
$data = array(array('CommentID', 'Post', 'Author', 'Date', 'Content'));
foreach ($comments as $comment) {
if ($comment->comment_approved) {
$tmpPost = get_post($comment->comment_post_ID);
array_push($data, array($comment->comment_ID, $tmpPost->post_title, $comment->comment_author, $comment->comment_date, $comment->comment_content));
}
}
$path = wp_upload_dir();
$filename = 'diav' . $diav_id . '_comments.xls';
$f = fopen($path['path'] . '/' . $filename, 'w');
if ($f === false) {
die('Error opening the file ' . $filename);
}
fputs($f, header('Content-Disposition: attachment; filename=""'));
fputs($f, header('Content-Type: application/vnd.ms-excel'));
$column_names = false;
foreach ($data as $row) {
if (!$column_names) {
fputs($f, implode(' ', array_keys($row)) . '
');
$column_names = true;
}
array_walk($row, 'filter_xls_data');
fputs($f, implode(' ', array_values($row)) . '
');
}
fclose($f);
return $path['url'] . '/' . $filename;
}
goto kOINK;
BPvyy:
add_filter('acf/update_value/name=start_date', 'update_start_date', 10, 3);
goto LzQsZ;
DVHTb:
function print_diavouleusi_articles($diav_id, $with_comments = true)
{
$posts = get_diav_articles_bytag($diav_id);
if ($posts != null) {
echo '<h3 class="diav-heading"></h3>';
echo '<table>';
foreach ($posts as $post) {
echo '<tr><td><a href="' . get_permalink($post) . '">' . $post->post_title . '</a></td>';
if ($with_comments) {
echo '<td><i aria-hidden="true" class="fas fa-comments"></i> ' . $post->comment_count;
if ($post->comment_count == 1) {
echo ' </td>';
} else {
echo ' </td>';
}
echo '</tr>';
}
}
echo '</table>';
} else {
echo 'No posts';
}
}
goto g37CM;
iKUR3:
function register_hourly_update_diavouleuseis_event()
{
if (!wp_next_scheduled('update_diavouleuseis6')) {
wp_schedule_event(time(), 'hourly', 'update_diavouleuseis6');
}
}
goto Rgqrj;
ESPZk:
function get_articles_link($diavouleusi_id)
{
$tagname = get_diavouleusi_tagname($diavouleusi_id);
$link = get_admin_url() . '/edit.php?post_type=article&tag=' . $tagname . '&orderby=title&order=asc';
return $link;
}
goto EK_p8;
J228e:
function generate_comments_csv($diav_id)
{
if (!$diav_id) {
return null;
}
$comments = get_diavouleusi_comments($diav_id);
if (!$comments) {
return -1;
}
$data = array(array('CommentID', 'Post', 'Author', 'Date', 'Content'));
foreach ($comments as $comment) {
if ($comment->comment_approved) {
$tmpPost = get_post($comment->comment_post_ID);
array_push($data, array($comment->comment_ID, $tmpPost->post_title, $comment->comment_author, $comment->comment_date, $comment->comment_content));
}
}
$path = wp_upload_dir();
$filename = 'diav' . $diav_id . '_comments.csv';
$f = fopen($path['path'] . '/' . $filename, 'w');
if ($f === false) {
die('Error opening the file ' . $filename);
}
fputs($f, '');
foreach ($data as $row) {
fputcsv($f, $row);
}
fclose($f);
return $path['url'] . '/' . $filename;
}
goto qz2s1;
TFErE:
function gnstl_deliberate()
{
$chosen = say_hello();
$lang = '';
if ('en_' !== substr(get_user_locale(), 0, 3)) {
$lang = ' lang="en"';
}
printf('<p id="genestial"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>', __('Genestial:', 'gnstl-deliberate'), $lang, $chosen);
}
goto eH5up;
LfuF0:
add_action('wp_trash_post', 'trash_diavouleusi_articles');
goto Lu60v;
FPNnq:
add_filter('acf/validate_value/name=end_date', 'validate_end_date', 10, 4);
goto ghhd5;
VPhMM:
add_filter('acf/validate_value/name=num_articles', 'validate_num_articles', 10, 4);
goto g6LeK;
suj3a:
function get_diavouleusi_author($diav_id)
{
$author_id = get_post_field('post_author', $diav_id);
return get_the_author_meta('display_name', $author_id);
}
goto LCHm5;
LuWBx:
add_shortcode('diavouleusi_articles', 'display_diavouleusi_articles');
goto pPM4h;
f3oJG:
function set_post_comment_status($post_id, $status = 'open')
{
global $wpdb;
$wpdb->update($wpdb->prefix . 'posts', array('comment_status' => $status), array('ID' => $post_id));
}
goto MkiZF;
FusFu:
function get_filetype_favicon($ext)
{
if ($ext == 'pdf') {
return '<i class="fas fa-file-pdf"></i>';
} else {
if ($ext == 'doc' || $ext == 'docx') {
return '<i class="fas fa-file-word"></i>';
} else {
if ($ext == 'xls' || $ext == 'xlsx') {
return '<i class="fas fa-file-excel"></i>';
}
}
}
}
goto z4Mlp;
EK_p8:
function get_diavouleusi_tagname($post_id)
{
return 'diav-' . $post_id;
}
goto FusFu;
qf2p2:
function has_ended($diav_id)
{
$curr_time = current_time('Y-m-d H:i:s');
$end_date = date('Y-m-d H:i:s', strtotime(get_field('end_date', $diav_id)));
if ($end_date <= $curr_time) {
return true;
}
return false;
}
goto X9xig;
nNphe:
function calculate_comment_status($diav_id)
{
$comment_status = 'closed';
$diav_status = get_diavouleusi_status($diav_id);
if ($diav_status == 'Active') {
$comment_status = 'open';
}
return $comment_status;
}
goto uOs8r;
j6uLm:
function display_article_diav($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$diavouleusi = get_field('diavouleusi', $attributes['id']);
$title = get_the_title($diavouleusi);
return '<div class="diav-title-inarticle">' . $title . '</div>';
}
goto rTFJW;
Jvdum:
add_action('acf/save_post', 'update_diavouleusi');
goto JFiCQ;
YgADs:
function update_newstatus_field($field)
{
$post = get_post();
$field['message'] = get_diavouleusi_status($post->ID);
return $field;
}
goto YZtmr;
uA183:
function is_valid_comment_status($status)
{
if ($status == 'closed' || status == 'open') {
return true;
}
return false;
}
goto zmZdY;
uFneL:
function get_diavouleusi_comments($diav_id)
{
$comments_all = get_comments(array('post_id' => $diav_id));
$articles = get_diav_articles_bytag($diav_id);
foreach ($articles as $article) {
$tmp_comments = null;
$tmp_comments = get_comments(array('post_id' => $article->ID));
if ($tmp_comments) {
foreach ($tmp_comments as $comment) {
array_push($comments_all, $comment);
}
}
}
return $comments_all;
}
goto J228e;
JkIJv:
add_action('schedule_diavouleusi_start', 'update_diavouleusi_starttime_event', 10, 3);
goto z0j_6;
kOINK:
function filter_xls_data(&$str)
{
$str = preg_replace('/ /', ' ', $str);
$str = preg_replace('/
?
/', '
', $str);
if (strstr($str, '"')) {
$str = '"' . str_replace('"', '""', $str) . '"';
}
}
goto DVHTb;
vr5ff:
function display_diavouleusi_themes($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
return get_diavouleusi_themes($attributes['id']);
}
goto eR9CG;
RuNcy:
function gnstl_register_my_taxes()
{
$labels = array('name' => esc_html__(' ', 'jannahchild'), 'singular_name' => esc_html__(' ', 'jannahchild'));
$args = array('label' => esc_html__(' ', 'jannahchild'), 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => array('slug' => 'dlb_theme', 'with_front' => true), 'show_admin_column' => true, 'show_in_rest' => true, 'show_tagcloud' => false, 'rest_base' => 'dlb_theme', 'rest_controller_class' => 'WP_REST_Terms_Controller', 'rest_namespace' => 'wp/v2', 'show_in_quick_edit' => false, 'sort' => false, 'show_in_graphql' => false);
register_taxonomy('dlb_theme', array('diavouleusi'), $args);
$labels = array('name' => esc_html__(' ', 'jannahchild'), 'singular_name' => esc_html__(' ', 'jannahchild'));
$args = array('label' => esc_html__(' ', 'jannahchild'), 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => array('slug' => 'dlb_type', 'with_front' => true), 'show_admin_column' => true, 'show_in_rest' => true, 'show_tagcloud' => false, 'rest_base' => 'dlb_type', 'rest_controller_class' => 'WP_REST_Terms_Controller', 'rest_namespace' => 'wp/v2', 'show_in_quick_edit' => false, 'sort' => false, 'show_in_graphql' => false);
register_taxonomy('dlb_type', array('diavouleusi'), $args);
}
goto ddMAG;
I0JJi:
function update_start_date($value, $post_id, $field)
{
$start_date = strtotime(get_field('start_date', $post_id));
$old_value = date('Y-m-d H:i:s', $start_date);
$new_value = $_POST['acf']['field_60b724c57d1b9'];
if ($old_value != $new_value) {
error_log('START DATE changed from ' . $old_value . ' to ' . $new_value . ' timestamp: ' . strtotime($new_value));
$timezone = 'Europe/Athens';
$new_date = new DateTime($new_value, new DateTimeZone($timezone));
$new_timestamp = $new_date->format('U');
$old_timestamp = wp_next_scheduled('schedule_diavouleusi_start');
error_log('Existing schedule: ' . $old_timestamp);
if ($old_timestamp) {
error_log('Unscheduling event');
wp_unschedule_event($old_timestamp, 'schedule_diavouleusi_start', array($post_id));
}
wp_schedule_single_event($new_timestamp, 'schedule_diavouleusi_start', array($post_id));
} else {
error_log('START DATE didnt change');
}
return $value;
}
goto BPvyy;
gigZQ:
function has_correct_comment_status($diav_id)
{
$diav_status = get_diavouleusi_status($diav_id);
$diav_post = get_post($diav_id);
$comment_status = $diav_post->comment_status;
if ($diav_status == 'Active') {
if ($comment_status == 'closed') {
return false;
}
return true;
} else {
if ($comment_status == 'open') {
return false;
}
return true;
}
}
goto qf2p2;
nb4GL:
function delete_diavouleusi_articles($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('Delete articles here');
$posts = get_diav_articles_bytag($post_id);
$count = 0;
if ($posts) {
foreach ($posts as $post) {
wp_delete_post($post->ID);
$count += 1;
}
} else {
$posts_trashed = get_diav_articles_bytag($post_id, true);
if ($posts_trashed) {
foreach ($posts_trashed as $post_t) {
wp_delete_post($post_t->ID);
$count += 1;
}
}
}
error_log('Articles deleted: ' . $count);
$tagname_todelete = get_diavouleusi_tagname($post_id);
$diav_tag = get_term_by('name', $tagname_todelete, 'post_tag');
if ($diav_tag) {
error_log('Term to delete: ' . $tagname_todelete . ' ID: ' . $diav_tag->term_id);
wp_delete_term($diav_tag->term_id, 'post_tag');
error_log('Term deleted');
}
}
goto rzM8F;
xQzbi:
add_filter('acf/fields/post_object/query/name=diavouleusi', 'filter_own_diavouleuseis', 10, 3);
goto US6aO;
h43LL:
function gnstl_profile_admin_css()
{
$screen_id = isset(get_current_screen()->id) ? get_current_screen()->id : null;
if ('profile' === $screen_id || 'user-edit' === $screen_id) {
wp_enqueue_style('profile-admin-css', '/wp-content/plugins/gnstl-deliberate/userprofile.css');
}
}
goto FAArC;
kSeDv:
add_shortcode('diavouleusi_resources', 'display_diavouleusi_resources');
goto XeIbK;
LCHm5:
function get_diavouleusi_rss_feed($diav_id)
{
$link = get_site_url() . '/feed?tag=' . get_diavouleusi_tagname($diav_id) . '&post_type=diavouleusi';
return $link;
}
goto gigZQ;
xaucG:
add_shortcode('diavouleusi_types', 'display_diavouleusi_types');
goto tCYtg;
MrpAk:
function display_diavouleusi_resources($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$resources = get_field_object('resources', $attributes['id']);
if ($resources) {
if (have_rows($resources['name'])) {
echo '<div class="diavouleusi-resources">';
echo '<h3 class="diav-heading"> </h3>';
echo '<ul>';
while (have_rows($resources['name'])) {
the_row();
$title = get_sub_field('title');
$file = get_sub_field('file');
$img = wp_get_attachment_image(get_sub_field('ID'));
$filetype = wp_check_filetype($file);
echo '<li><a href="' . $file . '" target="_blank" class="' . $filetype['ext'] . '">' . get_filetype_favicon($filetype['ext']) . ' ' . $title . '</a></li>';
}
echo '</ul>';
}
echo '</div>';
}
}
goto kSeDv;
ckDZM:
add_shortcode('articles_related', 'display_articles_related');
goto j6uLm;
z0j_6:
function update_diavouleusi_endtime_event($diav_id)
{
error_log('SCHEDULED Task UpdateEndTime executed for ' . $diav_id . ' @ ' . current_time('Y-m-d H:i:s'));
if (has_ended($diav_id)) {
update_diavouleusi_status($diav_id);
set_diavouleusi_comment_status($diav_id, 'closed');
} else {
error_log('Ignoring event');
}
}
goto YCYlT;
ghhd5:
function validate_num_articles($valid, $value, $field, $input_name)
{
if ($valid !== true) {
return $valid;
}
if ($_POST) {
if ($_POST['post_id'] != null) {
error_log('Getting numArticles via $_POST ' . $_POST['post_id']);
$posts = get_diav_articles_bytag($_POST['post_id']);
}
} else {
$currPost = get_post();
if ($currPost) {
$posts = get_diav_articles_bytagget_diav_articles_bytag($currPost->ID);
} else {
error_log('Error getting current post ID');
return;
}
}
$actualNumArticles = 0;
if ($posts) {
$actualNumArticles = sizeof($posts);
}
error_log('Line 688 Actual num: ' . $actualNumArticles);
foreach ($posts as $post) {
error_log('Post ID:: ' . $post->ID);
}
if ($actualNumArticles == 0) {
return $valid;
} else {
if ($value > $actualNumArticles) {
return __('Change number to ' . $actualNumArticles . ' or manually create ' . ($value - $actualNumArticles) . ' <a href="' . get_articles_link($_POST['post_id']) . '" target="_blank">article(s)</a>.');
} else {
if ($value < $actualNumArticles) {
return __('Change number to ' . $actualNumArticles . ' or manually delete ' . ($actualNumArticles - $value) . ' <a href="' . get_articles_link($_POST['post_id']) . '" target="_blank">article(s)</a>. <br/><em>Don't delete the <b>General comments</b> article.</em>');
} else {
return $valid;
}
}
}
}
goto VPhMM;
yGzF5:
function update_article_tag($field)
{
$post = get_post();
if ('article' !== get_post_type()) {
return $field;
}
$diav_id = $_POST['acf']['field_60bc93d67c929'];
if (!$diav_id) {
return $field;
}
error_log('DBG DiavID: ' . $diav_id);
$tag = get_diavouleusi_tagname($diav_id);
if ($tag) {
wp_set_post_tags($post->ID, array($tag), false);
}
error_log('Tags added');
connect_article_to_diav($post->ID, $diav_id);
error_log('Synced with diavouleusi');
return $field;
}
goto Tnu0E;
P1O7r:
add_action('untrash_post', 'untrash_diavouleusi_articles');
goto nb4GL;
rzM8F:
add_action('before_delete_post', 'delete_diavouleusi_articles');
goto Gp14y;
l5bPI:
add_filter('comments_clauses', 'gnstl_show_ownpost_comments');
goto Z2Lp0;
Tnu0E:
add_filter('acf/update_value/name=diavouleusi', 'update_article_tag');
goto v_sBd;
JJI4u:
add_shortcode('diavouleusi_intro_fields', 'display_diavouleusi_intro_fields');
goto MrpAk;
LzQsZ:
function update_end_date($value, $post_id, $field)
{
$end_date = strtotime(get_field('end_date', $post_id));
$old_value = date('Y-m-d H:i:s', $end_date);
$new_value = $_POST['acf']['field_60b725007d1ba'];
if ($old_value != $new_value) {
error_log('END DATE changed from ' . $old_value . ' to ' . $new_value . ' timestamp: ' . strtotime($new_value));
$timezone = 'Europe/Athens';
$new_date = new DateTime($new_value, new DateTimeZone($timezone));
$new_timestamp = $new_date->format('U');
$old_timestamp = wp_next_scheduled('schedule_diavouleusi_end');
error_log('Existing schedule: ' . $old_timestamp);
if ($old_timestamp) {
error_log('Unscheduling event');
wp_unschedule_event($old_timestamp, 'schedule_diavouleusi_end', array($post_id));
}
wp_schedule_single_event($new_timestamp, 'schedule_diavouleusi_end', array($post_id));
} else {
error_log('END DATE didnt change');
}
return $value;
}
goto UVsYJ;
yNeZU:
function display_diavouleusi_intro_fields($atts)
{
$attributes = shortcode_atts(array('id' => '', 'in_excerpt' => 1), $atts);
echo get_diavouleusi_intro_fields($attributes['id'], $attributes['in_excerpt']);
}
goto JJI4u;
bmO2b:
add_shortcode('diavouleusi_fields', 'display_diavouleusi_fields');
goto yNeZU;
Cprnd:
function connect_article_to_diav($article_id, $diav_id)
{
$article = get_post($article_id);
$diav = get_post($diav_id);
if (!$diav || !$article) {
error_log('No such post found');
return;
}
$numArticles = get_field('num_articles', $diav_id);
$update_args = array('ID' => $article_id, 'post_date' => $diav->post_date, 'post_status' => $diav->post_status, 'comment_status' => $diav->comment_status);
wp_update_post($update_args);
update_field('num_articles', $numArticles + 1, $diav_id);
}
goto lMN2H;
rTFJW:
add_shortcode('article_diav', 'display_article_diav');
goto iKUR3;
UVsYJ:
add_filter('acf/update_value/name=end_date', 'update_end_date', 10, 3);
goto yGzF5;
FAArC:
add_action('admin_enqueue_scripts', 'gnstl_profile_admin_css');
goto ESPZk;
X9xig:
function has_started($diav_id)
{
$curr_time = current_time('Y-m-d H:i:s');
$start_date = date('Y-m-d H:i:s', strtotime(get_field('start_date', $diav_id)));
if ($start_date > $curr_time) {
return false;
}
return true;
}
goto f3oJG;
YZtmr:
add_filter('acf/load_field/key=field_60e31013755bc', 'update_newstatus_field');
goto I0JJi;
eM3XR:
add_filter('pre_get_posts', 'gnstl_rss_feed');
goto ESXwZ;
PdbWc:
add_action('init', 'gnstl_register_my_cpts');
goto RuNcy;
YCkWN:
function update_diav_articles($diav_id, $post_date, $post_status, $comment_status)
{
$posts = get_diav_articles_bytag($diav_id);
$actualArticles = 0;
if ($posts) {
$actualArticles = sizeof($posts);
}
$expectedArticles = get_field('num_articles', $diav_id);
if ($actualArticles != $expectedArticles) {
return $actualArticles;
}
$update_args = array('ID' => 0, 'post_date' => $post_date, 'post_status' => $post_status, 'post_type' => 'article', 'post_title' => 'Article', 'post_name' => 'article', 'post_modified' => current_time('Y-m-d H:i:s'), 'post_content' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'comment_status' => $comment_status, 'ping_status' => '', 'post_password' => '', 'to_ping' => '', 'pinged' => '', 'post_parent' => '', 'menu_order' => '', 'post_mime_type' => '', 'guid' => '');
foreach ($posts as $post) {
$tmpPost = null;
$tmpPost = get_post($post->ID);
$update_args['ID'] = $post->ID;
$update_args['post_title'] = $tmpPost->post_title;
$update_args['post_name'] = $tmpPost->post_name;
$update_args['post_content'] = $tmpPost->post_content;
$update_args['post_content_filtered'] = $tmpPost->post_content_filtered;
$update_args['post_excerpt'] = $tmpPost->post_excerpt;
$update_args['ping_status'] = $tmpPost->ping_status;
$update_args['post_password'] = $tmpPost->post_password;
$update_args['to_ping'] = $tmpPost->to_ping;
$update_args['post_parent'] = $tmpPost->post_parent;
$update_args['menu_order'] = $tmpPost->menu_order;
$update_args['post_mime_type'] = $tmpPost->post_mime_type;
$update_args['guid'] = $tmpPost->guid;
$tmp = wp_insert_post($update_args);
update_field('diavouleusi', $diav_id, $post->ID);
}
return $actualArticles;
}
goto Cprnd;
Nouv2:
function get_diavouleusi_intro_fields($diav_id, $in_excerpt)
{
$status = get_diavouleusi_status($diav_id);
$diav_link = get_post_permalink($diav_id);
$rss_link = get_diavouleusi_rss_feed($diav_id);
$status_class = '';
$status_icon = '';
if ($status == 'Active' || $status == '') {
$status_text = '';
$status_class = '';
$status_icon = 'fa-unlock';
} else {
if ($status == 'In processing' || $status == ' ') {
$status_text = ' ';
$status_class = 'status-closed';
$status_icon = 'fa-lock';
} else {
if ($status == 'Completed' || $status == '') {
$status_text = '';
$status_class = 'status-complete';
$status_icon = 'fa-check-circle';
}
}
}
$val = '<div class="diavouleusi-info"><ul>';
$val .= '<li class="diavouleusi-status ' . $status_class . '"><i aria-hidden="true" class=" fas ' . $status_icon . '"></i>
<span>' . $status_text . '</span></li>';
$unixtimestamp = strtotime(get_field('start_date', $diav_id));
$start_date = date_i18n('d M Y @ G:i', $unixtimestamp);
$unixtimestamp2 = strtotime(get_field('end_date', $diav_id));
$end_date = date_i18n('d M Y @ G:i', $unixtimestamp2);
if ($in_excerpt) {
$start_pre = '<i aria-hidden="true" class="far fa-calendar-check"></i>';
$end_pre = '<i aria-hidden="true" class="far fa-calendar-times"></i>';
} else {
$start_pre = '<em></em><br/>';
$end_pre = '<em> </em><br/>';
}
$val .= '<li class="diavouleusi-date">' . $start_pre . ' <strong>' . $start_date . '</strong></li>';
$val .= '<li class="diavouleusi-date">' . $end_pre . ' <strong>' . $end_date . '</strong></li>';
if (!$in_excerpt) {
$val .= '<li class="emphasis"><i aria-hidden="true" class="fas fa-comments"></i> <span>' . get_diavouleusi_comment_count($diav_id) . ' </span></li>';
}
$val .= '</ul></div>';
$val .= '<div class="diavouleusi-actions"><ul>';
if ($status == 'Active' || $status == '') {
$val .= '<li><a class="button" href="' . $diav_link . '/' . '#articles' . '"><i aria-hidden="true" class="fas fa-comment-medical"></i> </a></li>';
}
$tmpCSV = generate_comments_csv($diav_id);
$action_status = '';
if (!$tmpCSV || $tmpCSV < 0) {
$val .= '<li><a class="button disabled" href="#"><em> </em></a></li>';
} else {
$val .= '<li><a class="button" href="' . $tmpCSV . '"><i aria-hidden="true" class="fas fa-file-export"></i> </a></li>';
}
if ($status != 'Completed') {
$val .= '<li><a class="button" href="' . $rss_link . '" target="_blank"><i aria-hidden="true" class="fas fa-rss"></i> </a></li>';
}
if ($status == 'Completed' && $in_excerpt) {
$val = $val . '<li><a class="button button-emphasis" href="' . $diav_link . '/#results"><i aria-hidden="true" class="fas fa-poll-h"></i> </a></li>';
}
$val .= '</ul></div>';
return $val;
}
goto us28k;
pPM4h:
function display_diavouleusi_fields($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$fields = get_field_objects($attributes['id']);
if ($fields) {
echo '<ul>';
foreach ($fields as $field) {
if ($field['type'] != 'repeater') {
echo '<li><strong>' . $field['label'] . ':</strong> ' . $field['value'] . '</li>';
} else {
echo '<li><strong>' . $field['label'] . ':</strong>';
if (have_rows($field['name'])) {
echo '<ul>';
while (have_rows($field['name'])) {
the_row();
$title = get_sub_field('title');
$file = get_sub_field('file');
echo '<li><a href="' . $file . '" target="_blank">' . $title . '</a></li>';
}
echo '</ul>';
}
echo '</li>';
}
}
echo '</ul>';
}
}
goto bmO2b;
rkZHE:
add_filter('acf/load_field/key=field_60dc1e1cff1c5', 'update_article_link_field');
goto YgADs;
ZpOt9:
register_activation_hook(__FILE__, 'plugin_dependencies_activate');
goto h43LL;
eH5up:
function genestial_css()
{
echo '
<style type='text/css'>
#genestial {
float: right;
padding: 5px 10px;
margin: 0;
font-size: 12px;
line-height: 1.6666;
}
.rtl #genestial {
float: left;
}
.block-editor-page #genestial {
display: none;
}
@media screen and (max-width: 782px) {
#genestial,
.rtl #genestial {
float: none;
padding-left: 0;
padding-right: 0;
}
}
</style>
';
}
goto FLCb6;
JFiCQ:
function trash_diavouleusi_articles($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('Trash articles here');
$posts = get_diav_articles_bytag($post_id);
if ($posts) {
foreach ($posts as $post) {
wp_trash_post($post->ID);
}
}
error_log('Articles trashed');
}
goto LfuF0;
Lu60v:
function untrash_diavouleusi_articles($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('Untrash articles here');
$posts = get_diav_articles_bytag($post_id, true);
$count = 0;
if ($posts) {
foreach ($posts as $post) {
wp_untrash_post($post->ID);
$count += 1;
}
}
error_log('Articles untrashed: ' . $count);
}
goto P1O7r;
xM0gL:
function gnstl_rss_feed($query)
{
if ($query->is_feed()) {
$query->set('post_type', array('post', 'diavouleusi', 'article'));
}
return $query;
}
goto eM3XR;
ddMAG:
add_action('init', 'gnstl_register_my_taxes');
?>
Did this file decode correctly?
Original Code
<?php
goto VRYAx;
oy8KA:
function update_diavouleusi_status($diav_id)
{
$post = get_post($diav_id);
$val = null;
if ($post->post_status == 'draft') {
$val = 'Draft';
} else {
$curr_time = current_time('Y-m-d H:i:s');
$start_date = date('Y-m-d H:i:s', strtotime(get_field('start_date', $diav_id)));
$end_date = date('Y-m-d H:i:s', strtotime(get_field('end_date', $diav_id)));
if ($start_date > $curr_time) {
$val = 'Scheduled';
} else {
if ($end_date > $curr_time) {
$val = 'Active';
} else {
$results = get_field('multiresults', $diav_id);
if ($results != null) {
$val = 'Completed';
} else {
$val = 'In processing';
}
}
}
error_log('Currtime: ' . $curr_time . ' StartDate:' . $start_date . ' strToTime: ' . strtotime(get_field('start_date', $diav_id)) . ' EndDate: ' . $end_date . ' Status: ' . $val);
}
update_field('status_hidden', $val, $diav_id);
return true;
}
goto GQldR;
lMN2H:
function set_diavouleusi_comment_status($diav_id, $status = 'closed')
{
$diav = get_post($diav_id);
set_post_comment_status($diav_id, $status);
update_articles_comment_status($diav_id, $status);
}
goto Nouv2;
v_sBd:
function diavouleusi_excerpt($excerpt)
{
if ('diavouleusi' !== get_post_type()) {
return $excerpt;
}
$post = get_post();
$extraExcerpt = '<div class="two_third tie-columns diav-content">';
$extraExcerpt .= '<span class="diav-author">' . get_diavouleusi_author($post->ID) . '</span>';
$extraExcerpt .= $excerpt;
$extraExcerpt .= get_diavouleusi_themes($post->ID);
$extraExcerpt .= get_diavouleusi_types($post->ID);
$extraExcerpt .= '</div><div class="one_third tie-columns last diav-fields">' . get_diavouleusi_intro_fields($post->ID, 1) . '</div>';
return $extraExcerpt;
}
goto X7v4v;
bD2Fo:
function get_diavouleusi_types($diav_id)
{
$val = '';
$terms = get_the_terms($diav_id, 'dlb_type');
if ($terms) {
$val = '<div class="post-badges dlb_type">';
foreach ($terms as $term) {
$val .= '<div class="post-badge">' . $term->name . '</div>';
}
$val .= '</div>';
}
return $val;
}
goto nNphe;
z4Mlp:
function get_diavouleusi_themes($diav_id)
{
$val = '';
$terms = get_the_terms($diav_id, 'dlb_theme');
if ($terms) {
$val = '<div class="post-badges">';
foreach ($terms as $term) {
$val .= '<div class="post-badge">' . $term->name . '</div>';
}
$val .= '</div>';
}
return $val;
}
goto bD2Fo;
US6aO:
function gnstl_show_ownpost_comments($clauses)
{
if (is_admin()) {
if (current_user_can('edit_others_posts')) {
return $clauses;
} else {
$user_id = get_current_user_id();
global $wpdb;
$clauses['join'] = ', ' . $wpdb->base_prefix . 'posts';
$clauses['where'] .= ' AND ' . $wpdb->base_prefix . 'comments.comment_post_ID = ' . $wpdb->base_prefix . 'posts.ID' . ' AND (' . $wpdb->base_prefix . 'posts.post_author = ' . $user_id . ' OR ' . $wpdb->base_prefix . 'comments.user_id = ' . $user_id . ')';
}
}
return $clauses;
}
goto l5bPI;
Rgqrj:
function update_all_diavouleuseis()
{
$timezone = new DateTimeZone('Europe/Athens');
error_log('Cron started at: ' . wp_date('Y-m-d H:i:s', null, $timezone));
$args = array('post_type' => 'diavouleusi', 'orderby' => 'post_date', 'order' => 'ASC', 'post_status' => 'publish');
$query = new WP_Query($args);
$diavouleuseis = $query->posts;
foreach ($diavouleuseis as $diav) {
if (!has_correct_comment_status($diav->ID)) {
$comment_status = calculate_comment_status($diav->ID);
update_articles_comment_status($diav->ID, $comment_status);
}
}
wp_reset_query();
error_log('Cron complete at: ' . wp_date('Y-m-d H:i:s', null, $timezone));
}
goto kYY1r;
VRYAx:
function say_hello()
{
$txt = 'Welcome to the eConsultation platform! <em>' . date_i18n('Y-m-d H:i:s', null) . '</em>';
return $txt;
}
goto TFErE;
GQldR:
function get_diavouleusi_status($diav_id)
{
return get_field('status_hidden', $diav_id);
}
goto suj3a;
Gp14y:
function display_diavouleusi_articles($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
print_diavouleusi_articles($attributes['id']);
}
goto LuWBx;
zmZdY:
function calculate_diav_post_status($diav_id)
{
$currTime = current_time('Y-m-d H:i:s');
$startDate = strtotime(get_field('start_date', $diav_id));
$newPostDate = date('Y-m-d H:i:s', $startDate);
$currPostStatus = get_post_status($diav_id);
$newPostStatus = $currPostStatus;
if ($currPostStatus == 'publish') {
if ($newPostDate > $currTime) {
$newPostStatus = 'future';
}
} else {
if ($currPostStatus == 'future') {
if ($newPostDate <= $currTime) {
$newPostStatus = 'publish';
}
}
}
return $newPostStatus;
}
goto oy8KA;
ZI4HF:
function display_diavouleusi_types($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
return get_diavouleusi_types($attributes['id']);
}
goto xaucG;
X7v4v:
add_filter('the_excerpt', 'diavouleusi_excerpt', 10, 1);
goto xM0gL;
g37CM:
function create_diavouleusi_articles($diav_id, $post_date, $post_status, $comment_status)
{
$num_articles = get_field('num_articles', $diav_id);
$tmpPost = get_post($diav_id);
$article_args = array('post_title' => ' ', 'post_type' => 'article', 'post_date' => $post_date, 'post_status' => $post_status, 'post_content' => '', 'post_author' => $tmpPost->post_author, 'comment_status' => $comment_status, 'tags_input' => get_diavouleusi_tagname($diav_id));
$article_index = '';
for ($i = 1; $i <= $num_articles; $i++) {
$article_index = sprintf('%02d', $i);
$article_args['post_title'] = $article_index . ' - ';
$tmpArticleID = wp_insert_post($article_args);
update_field('diavouleusi', $diav_id, $tmpArticleID);
}
}
goto Vtam5;
g6LeK:
function update_article_link_field($field)
{
$post = get_post();
$field['message'] = '<a class="button" href="' . get_articles_link($post->ID) . '" target="_blank"> </a>';
return $field;
}
goto rkZHE;
us28k:
function validate_end_date($valid, $value, $field, $input_name)
{
if ($valid !== true) {
return $valid;
}
$startDate = $_POST['acf']['field_60b724c57d1b9'];
$interval = date_diff(date_create($startDate), date_create($value));
if ($interval->format('%R%a') < 1) {
return __('The end date should be at least <b>1 day</b> after the start date.');
}
return $valid;
}
goto FPNnq;
MkiZF:
function get_diav_articles_bytag($diav_id, $trashed = false)
{
$tag_name = get_diavouleusi_tagname($diav_id);
$tag = get_term_by('name', $tag_name, 'post_tag');
error_log('Line 274 tag ' . $tag_name);
if (!$tag) {
return null;
}
$status = array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'inherit', 'trash');
if ($trashed == true) {
$status = 'trashed';
}
$args = array('post_type' => 'article', 'tag' => $tag_name, 'orderby' => 'post_title', 'order' => 'ASC', 'post_status' => $status, 'nopaging' => true);
$query = new WP_Query($args);
$posts = $query->posts;
error_log('Returned posts: ' . sizeof($posts));
foreach ($posts as $post) {
error_log('Post ID:: ' . $post->ID);
}
return $posts;
}
goto uFneL;
UZiYd:
function display_article_fields($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$diavouleusi = get_field('diavouleusi', $attributes['id']);
$link = get_post_permalink($diavouleusi);
return '<div class="diavouleusi-actions"><a href="' . $link . '" class="button btn"> </a></div>';
}
goto lcmYP;
eR9CG:
add_shortcode('diavouleusi_themes', 'display_diavouleusi_themes');
goto ZI4HF;
kYY1r:
function update_diavouleusi_starttime_event($diav_id)
{
error_log('SCHEDULED Task UpdateStartTime executed for ' . $diav_id . ' @ ' . current_time('Y-m-d H:i:s'));
if (has_started($diav_id)) {
update_diavouleusi_status($diav_id);
} else {
error_log('Ignoring event');
}
}
goto JkIJv;
FLCb6:
add_action('admin_head', 'genestial_css');
goto QHvnJ;
NJ6Au:
function gnstl_register_my_cpts()
{
$labels = array('name' => esc_html__('', 'jannahchild'), 'singular_name' => esc_html__('', 'jannahchild'), 'menu_name' => esc_html__('', 'jannahchild'), 'all_items' => esc_html__(' ', 'jannahchild'), 'add_new' => esc_html__(' ', 'jannahchild'), 'add_new_item' => esc_html__(' ', 'jannahchild'), 'edit_item' => esc_html__(' ', 'jannahchild'), 'new_item' => esc_html__(' ', 'jannahchild'), 'view_item' => esc_html__(' ', 'jannahchild'), 'view_items' => esc_html__(' ', 'jannahchild'), 'search_items' => esc_html__(' ', 'jannahchild'), 'not_found' => esc_html__(' ', 'jannahchild'), 'not_found_in_trash' => esc_html__(' ', 'jannahchild'), 'parent' => esc_html__('Parent Diavouleusi:', 'jannahchild'), 'featured_image' => esc_html__(' ', 'jannahchild'), 'set_featured_image' => esc_html__(' ', 'jannahchild'), 'remove_featured_image' => esc_html__(' ', 'jannahchild'), 'use_featured_image' => esc_html__(' ', 'jannahchild'), 'archives' => esc_html__(' ', 'jannahchild'), 'insert_into_item' => esc_html__('Insert into Diavouleusi', 'jannahchild'), 'uploaded_to_this_item' => esc_html__('Upload to this Diavouleusi', 'jannahchild'), 'filter_items_list' => esc_html__('Filter Diavouleuseis list', 'jannahchild'), 'items_list_navigation' => esc_html__('Diavouleuseis list navigation', 'jannahchild'), 'items_list' => esc_html__(' ', 'jannahchild'), 'attributes' => esc_html__('Diavouleuseis attributes', 'jannahchild'), 'name_admin_bar' => esc_html__('', 'jannahchild'), 'item_published' => esc_html__(' ', 'jannahchild'), 'item_published_privately' => esc_html__(' .', 'jannahchild'), 'item_reverted_to_draft' => esc_html__(' .', 'jannahchild'), 'item_scheduled' => esc_html__(' .', 'jannahchild'), 'item_updated' => esc_html__(' .', 'jannahchild'), 'parent_item_colon' => esc_html__('Parent Diavouleusi:', 'jannahchild'));
$args = array('label' => esc_html__('', 'jannahchild'), 'labels' => $labels, 'description' => '', 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_rest' => true, 'rest_base' => 'diavouleuseis', 'rest_controller_class' => 'WP_REST_Posts_Controller', 'rest_namespace' => 'wp/v2', 'has_archive' => 'diavouleuseis', 'show_in_menu' => true, 'show_in_nav_menus' => true, 'delete_with_user' => false, 'exclude_from_search' => false, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'can_export' => false, 'rewrite' => array('slug' => 'diavouleusi', 'with_front' => false), 'query_var' => true, 'menu_icon' => 'dashicons-format-chat', 'supports' => array('title', 'editor', 'excerpt', 'custom-fields', 'comments', 'revisions', 'author', 'post-formats'), 'taxonomies' => array('post_tag', 'dlb_theme'), 'show_in_graphql' => false);
register_post_type('diavouleusi', $args);
$labels = array('name' => esc_html__(' ', 'jannahchild'), 'singular_name' => esc_html__(' ', 'jannahchild'), 'menu_name' => esc_html__(' ', 'jannahchild'), 'all_items' => esc_html__(' ', 'jannahchild'), 'add_new' => esc_html__(' ', 'jannahchild'), 'add_new_item' => esc_html__(' ', 'jannahchild'), 'edit_item' => esc_html__(' ', 'jannahchild'), 'new_item' => esc_html__(' ', 'jannahchild'), 'view_item' => esc_html__(' ', 'jannahchild'), 'view_items' => esc_html__(' ', 'jannahchild'), 'search_items' => esc_html__(' ', 'jannahchild'), 'not_found' => esc_html__(' ', 'jannahchild'), 'not_found_in_trash' => esc_html__(' ', 'jannahchild'), 'parent' => esc_html__('Parent Article:', 'jannahchild'), 'featured_image' => esc_html__('Featured image for this Article', 'jannahchild'), 'set_featured_image' => esc_html__('Set featured image for this Article', 'jannahchild'), 'remove_featured_image' => esc_html__('Remove featured image for this Article', 'jannahchild'), 'use_featured_image' => esc_html__('Use as featured image for this Article', 'jannahchild'), 'archives' => esc_html__('Article archives', 'jannahchild'), 'insert_into_item' => esc_html__('Insert into Article', 'jannahchild'), 'uploaded_to_this_item' => esc_html__('Upload to this Article', 'jannahchild'), 'filter_items_list' => esc_html__('Filter Articles list', 'jannahchild'), 'items_list_navigation' => esc_html__('Articles list navigation', 'jannahchild'), 'items_list' => esc_html__('Articles list', 'jannahchild'), 'attributes' => esc_html__('Articles attributes', 'jannahchild'), 'name_admin_bar' => esc_html__(' ', 'jannahchild'), 'item_published' => esc_html__('Article published', 'jannahchild'), 'item_published_privately' => esc_html__('Article published privately.', 'jannahchild'), 'item_reverted_to_draft' => esc_html__('Article reverted to draft.', 'jannahchild'), 'item_scheduled' => esc_html__('Article scheduled', 'jannahchild'), 'item_updated' => esc_html__('Article updated.', 'jannahchild'), 'parent_item_colon' => esc_html__('Parent Article:', 'jannahchild'));
$args = array('label' => esc_html__(' ', 'jannahchild'), 'labels' => $labels, 'description' => '', 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_rest' => true, 'rest_base' => '', 'rest_controller_class' => 'WP_REST_Posts_Controller', 'rest_namespace' => 'wp/v2', 'has_archive' => false, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'delete_with_user' => false, 'exclude_from_search' => false, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => true, 'can_export' => false, 'rewrite' => array('slug' => 'article', 'with_front' => true), 'query_var' => true, 'menu_icon' => 'dashicons-media-document', 'supports' => array('title', 'editor', 'custom-fields', 'comments', 'revisions', 'author'), 'taxonomies' => array('post_tag'), 'show_in_graphql' => false);
register_post_type('article', $args);
}
goto PdbWc;
lcmYP:
add_shortcode('article_fields', 'display_article_fields');
goto vr5ff;
XeIbK:
function display_diavouleusi_results($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
if (get_diavouleusi_status($attributes['id']) != 'Completed') {
return;
}
$resources = get_field_object('multiresults', $attributes['id']);
if ($resources) {
echo '<div class="diavouleusi-results">';
echo '<h3 class="diav-heading">' . $resources['label'] . '</h3>';
if (have_rows($resources['name'])) {
echo '<ul>';
while (have_rows($resources['name'])) {
the_row();
$title = get_sub_field('title');
$file = get_sub_field('file');
$img = wp_get_attachment_image(get_sub_field('ID'));
$filetype = wp_check_filetype($file);
echo '<li><a href="' . $file . '" target="_blank" class="' . $filetype['ext'] . '">' . get_filetype_favicon($filetype['ext']) . ' ' . $title . '</a></li>';
}
echo '</ul>';
}
echo '</div>';
}
}
goto HjeJD;
Vtam5:
function update_articles_comment_status($diav_id, $comment_status)
{
$posts = get_diav_articles_bytag($diav_id);
if (!$posts) {
return;
}
if (!is_valid_comment_status($comment_status)) {
error_log('Invalid comment status: ' . $comment_status . '. Returning...');
return;
}
$update_args = array('ID' => 0, 'post_date' => '', 'post_status' => '', 'post_type' => 'article', 'post_title' => '', 'post_name' => '', 'post_modified' => '', 'post_content' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'comment_status' => $comment_status, 'ping_status' => '', 'post_password' => '', 'to_ping' => '', 'pinged' => '', 'post_parent' => '', 'menu_order' => '', 'post_mime_type' => '', 'guid' => '');
foreach ($posts as $post) {
$tmpPost = null;
$tmpPost = get_post($post->ID);
$update_args['ID'] = $post->ID;
$update_args['post_date'] = $tmpPost->post_date;
$update_args['post_status'] = $tmpPost->post_status;
$update_args['post_title'] = $tmpPost->post_title;
$update_args['post_name'] = $tmpPost->post_name;
$update_args['post_modified'] = $tmpPost->post_modified;
$update_args['post_content'] = $tmpPost->post_content;
$update_args['post_content_filtered'] = $tmpPost->post_content_filtered;
$update_args['post_excerpt'] = $tmpPost->post_excerpt;
$update_args['ping_status'] = $tmpPost->ping_status;
$update_args['post_password'] = $tmpPost->post_password;
$update_args['to_ping'] = $tmpPost->to_ping;
$update_args['pinged'] = $tmpPost->pinged;
$update_args['post_parent'] = $tmpPost->post_parent;
$update_args['menu_order'] = $tmpPost->menu_order;
$update_args['post_mime_type'] = $tmpPost->post_mime_type;
$update_args['guid'] = $tmpPost->guid;
$tmp = wp_insert_post($update_args);
}
}
goto YCkWN;
tCYtg:
function display_articles_related($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$diavouleusi = get_field('diavouleusi', $attributes['id']);
print_diavouleusi_articles($diavouleusi, false);
}
goto ckDZM;
Z2Lp0:
function update_diavouleusi($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('In update_diavouleusi');
if (defined('REST_REQUEST') && REST_REQUEST) {
return;
}
if (wp_is_post_revision($post_id) || wp_is_post_autosave($post_id)) {
return;
}
$tag_name = get_diavouleusi_tagname($post_id);
$tag_exists = term_exists($tag_name, 'post_tag');
$tag_changed = true;
if (!$tag_exists) {
$tmp = wp_insert_term($tag_name, 'post_tag');
if ($tmp) {
error_log('TAG CREATED: ' . $tag_name . ' POST id: ' . $post_id);
}
} else {
$posttags = get_the_tags($post_id);
if ($posttags) {
foreach ($posttags as $tag) {
error_log('Tag: ' . $tag->name);
if ($tag->name == $tag_name) {
$tag_changed = false;
break;
}
}
}
}
error_log('TAG CHANGE: ' . $tag_changed);
$currPostDate = get_the_date('Y-m-d H:i:s', $post_id);
$startDate = strtotime(get_field('start_date', $post_id));
$newPostDate = date('Y-m-d H:i:s', $startDate);
$start_date_changed = $newPostDate != $currPostDate;
$currPostStatus = get_post_status($post_id);
$newPostStatus = calculate_diav_post_status($post_id);
$status_changed = $newPostStatus != $currPostStatus;
$tmpPost = get_post($post_id);
$currCommentStatus = $tmpPost->comment_status;
$newCommentStatus = calculate_comment_status($post_id);
$comments_changed = $newCommentStatus != $currCommentStatus;
if ($comments_changed) {
error_log('Comment status changed to ' . $newCommentStatus);
}
if ($start_date_changed || $status_changed || $comments_changed || $tag_changed) {
$update_args = array('ID' => $post_id, 'post_date' => $newPostDate, 'post_date_gmt' => gmdate('Y-m-d H:i:s', $startDate), 'comment_status' => $newCommentStatus, 'post_status' => $newPostStatus, 'tags_input' => $tag_name);
remove_action('acf/save_post', 'build_diavouleusi');
wp_update_post($update_args, false, true);
add_action('acf/save_post', 'build_diavouleusi');
}
update_diavouleusi_status($post_id);
$articlesUpdated = update_diav_articles($post_id, $newPostDate, $newPostStatus, $newCommentStatus);
if ($articlesUpdated == 0) {
create_diavouleusi_articles($post_id, $newPostDate, $newPostStatus, $newCommentStatus);
}
}
goto Jvdum;
QHvnJ:
function plugin_dependencies_activate()
{
if (!is_plugin_active('advanced-custom-fields/acf.php') and current_user_can('activate_plugins')) {
wp_die('Sorry, but this plugin requires the plugins "Custom Post Type UI" and "Advanced Custom Fields" to be installed and active. <br><a href="' . admin_url('plugins.php') . '">« Return to Plugins</a>');
}
}
goto ZpOt9;
YCYlT:
add_action('schedule_diavouleusi_end', 'update_diavouleusi_endtime_event', 10, 3);
goto NJ6Au;
uOs8r:
function get_diavouleusi_comment_count($diav_id)
{
$total = 0;
$total = get_comments_number($diav_id);
$articles = get_diav_articles_bytag($diav_id);
foreach ($articles as $article) {
$total = $total + get_comments_number($article->ID);
}
return $total;
}
goto uA183;
ESXwZ:
function filter_own_diavouleuseis($args, $field, $post_id)
{
$user_id = get_current_user_id();
if (current_user_can('edit_others_posts')) {
return $args;
}
$args = array('author' => $user_id, 'post_type' => 'diavouleusi');
return $args;
}
goto xQzbi;
HjeJD:
add_shortcode('diavouleusi_results', 'display_diavouleusi_results');
goto UZiYd;
qz2s1:
function generate_comments_xls($diav_id)
{
if (!$diav_id) {
return null;
}
$comments = get_diavouleusi_comments($diav_id);
if (!$comments) {
return -1;
}
$data = array(array('CommentID', 'Post', 'Author', 'Date', 'Content'));
foreach ($comments as $comment) {
if ($comment->comment_approved) {
$tmpPost = get_post($comment->comment_post_ID);
array_push($data, array($comment->comment_ID, $tmpPost->post_title, $comment->comment_author, $comment->comment_date, $comment->comment_content));
}
}
$path = wp_upload_dir();
$filename = 'diav' . $diav_id . '_comments.xls';
$f = fopen($path['path'] . '/' . $filename, 'w');
if ($f === false) {
die('Error opening the file ' . $filename);
}
fputs($f, header('Content-Disposition: attachment; filename=""'));
fputs($f, header('Content-Type: application/vnd.ms-excel'));
$column_names = false;
foreach ($data as $row) {
if (!$column_names) {
fputs($f, implode(' ', array_keys($row)) . '
');
$column_names = true;
}
array_walk($row, 'filter_xls_data');
fputs($f, implode(' ', array_values($row)) . '
');
}
fclose($f);
return $path['url'] . '/' . $filename;
}
goto kOINK;
BPvyy:
add_filter('acf/update_value/name=start_date', 'update_start_date', 10, 3);
goto LzQsZ;
DVHTb:
function print_diavouleusi_articles($diav_id, $with_comments = true)
{
$posts = get_diav_articles_bytag($diav_id);
if ($posts != null) {
echo '<h3 class="diav-heading"></h3>';
echo '<table>';
foreach ($posts as $post) {
echo '<tr><td><a href="' . get_permalink($post) . '">' . $post->post_title . '</a></td>';
if ($with_comments) {
echo '<td><i aria-hidden="true" class="fas fa-comments"></i> ' . $post->comment_count;
if ($post->comment_count == 1) {
echo ' </td>';
} else {
echo ' </td>';
}
echo '</tr>';
}
}
echo '</table>';
} else {
echo 'No posts';
}
}
goto g37CM;
iKUR3:
function register_hourly_update_diavouleuseis_event()
{
if (!wp_next_scheduled('update_diavouleuseis6')) {
wp_schedule_event(time(), 'hourly', 'update_diavouleuseis6');
}
}
goto Rgqrj;
ESPZk:
function get_articles_link($diavouleusi_id)
{
$tagname = get_diavouleusi_tagname($diavouleusi_id);
$link = get_admin_url() . '/edit.php?post_type=article&tag=' . $tagname . '&orderby=title&order=asc';
return $link;
}
goto EK_p8;
J228e:
function generate_comments_csv($diav_id)
{
if (!$diav_id) {
return null;
}
$comments = get_diavouleusi_comments($diav_id);
if (!$comments) {
return -1;
}
$data = array(array('CommentID', 'Post', 'Author', 'Date', 'Content'));
foreach ($comments as $comment) {
if ($comment->comment_approved) {
$tmpPost = get_post($comment->comment_post_ID);
array_push($data, array($comment->comment_ID, $tmpPost->post_title, $comment->comment_author, $comment->comment_date, $comment->comment_content));
}
}
$path = wp_upload_dir();
$filename = 'diav' . $diav_id . '_comments.csv';
$f = fopen($path['path'] . '/' . $filename, 'w');
if ($f === false) {
die('Error opening the file ' . $filename);
}
fputs($f, '');
foreach ($data as $row) {
fputcsv($f, $row);
}
fclose($f);
return $path['url'] . '/' . $filename;
}
goto qz2s1;
TFErE:
function gnstl_deliberate()
{
$chosen = say_hello();
$lang = '';
if ('en_' !== substr(get_user_locale(), 0, 3)) {
$lang = ' lang="en"';
}
printf('<p id="genestial"><span class="screen-reader-text">%s </span><span dir="ltr"%s>%s</span></p>', __('Genestial:', 'gnstl-deliberate'), $lang, $chosen);
}
goto eH5up;
LfuF0:
add_action('wp_trash_post', 'trash_diavouleusi_articles');
goto Lu60v;
FPNnq:
add_filter('acf/validate_value/name=end_date', 'validate_end_date', 10, 4);
goto ghhd5;
VPhMM:
add_filter('acf/validate_value/name=num_articles', 'validate_num_articles', 10, 4);
goto g6LeK;
suj3a:
function get_diavouleusi_author($diav_id)
{
$author_id = get_post_field('post_author', $diav_id);
return get_the_author_meta('display_name', $author_id);
}
goto LCHm5;
LuWBx:
add_shortcode('diavouleusi_articles', 'display_diavouleusi_articles');
goto pPM4h;
f3oJG:
function set_post_comment_status($post_id, $status = 'open')
{
global $wpdb;
$wpdb->update($wpdb->prefix . 'posts', array('comment_status' => $status), array('ID' => $post_id));
}
goto MkiZF;
FusFu:
function get_filetype_favicon($ext)
{
if ($ext == 'pdf') {
return '<i class="fas fa-file-pdf"></i>';
} else {
if ($ext == 'doc' || $ext == 'docx') {
return '<i class="fas fa-file-word"></i>';
} else {
if ($ext == 'xls' || $ext == 'xlsx') {
return '<i class="fas fa-file-excel"></i>';
}
}
}
}
goto z4Mlp;
EK_p8:
function get_diavouleusi_tagname($post_id)
{
return 'diav-' . $post_id;
}
goto FusFu;
qf2p2:
function has_ended($diav_id)
{
$curr_time = current_time('Y-m-d H:i:s');
$end_date = date('Y-m-d H:i:s', strtotime(get_field('end_date', $diav_id)));
if ($end_date <= $curr_time) {
return true;
}
return false;
}
goto X9xig;
nNphe:
function calculate_comment_status($diav_id)
{
$comment_status = 'closed';
$diav_status = get_diavouleusi_status($diav_id);
if ($diav_status == 'Active') {
$comment_status = 'open';
}
return $comment_status;
}
goto uOs8r;
j6uLm:
function display_article_diav($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$diavouleusi = get_field('diavouleusi', $attributes['id']);
$title = get_the_title($diavouleusi);
return '<div class="diav-title-inarticle">' . $title . '</div>';
}
goto rTFJW;
Jvdum:
add_action('acf/save_post', 'update_diavouleusi');
goto JFiCQ;
YgADs:
function update_newstatus_field($field)
{
$post = get_post();
$field['message'] = get_diavouleusi_status($post->ID);
return $field;
}
goto YZtmr;
uA183:
function is_valid_comment_status($status)
{
if ($status == 'closed' || status == 'open') {
return true;
}
return false;
}
goto zmZdY;
uFneL:
function get_diavouleusi_comments($diav_id)
{
$comments_all = get_comments(array('post_id' => $diav_id));
$articles = get_diav_articles_bytag($diav_id);
foreach ($articles as $article) {
$tmp_comments = null;
$tmp_comments = get_comments(array('post_id' => $article->ID));
if ($tmp_comments) {
foreach ($tmp_comments as $comment) {
array_push($comments_all, $comment);
}
}
}
return $comments_all;
}
goto J228e;
JkIJv:
add_action('schedule_diavouleusi_start', 'update_diavouleusi_starttime_event', 10, 3);
goto z0j_6;
kOINK:
function filter_xls_data(&$str)
{
$str = preg_replace('/ /', '\t', $str);
$str = preg_replace('/
?
/', '\n', $str);
if (strstr($str, '"')) {
$str = '"' . str_replace('"', '""', $str) . '"';
}
}
goto DVHTb;
vr5ff:
function display_diavouleusi_themes($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
return get_diavouleusi_themes($attributes['id']);
}
goto eR9CG;
RuNcy:
function gnstl_register_my_taxes()
{
$labels = array('name' => esc_html__(' ', 'jannahchild'), 'singular_name' => esc_html__(' ', 'jannahchild'));
$args = array('label' => esc_html__(' ', 'jannahchild'), 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => array('slug' => 'dlb_theme', 'with_front' => true), 'show_admin_column' => true, 'show_in_rest' => true, 'show_tagcloud' => false, 'rest_base' => 'dlb_theme', 'rest_controller_class' => 'WP_REST_Terms_Controller', 'rest_namespace' => 'wp/v2', 'show_in_quick_edit' => false, 'sort' => false, 'show_in_graphql' => false);
register_taxonomy('dlb_theme', array('diavouleusi'), $args);
$labels = array('name' => esc_html__(' ', 'jannahchild'), 'singular_name' => esc_html__(' ', 'jannahchild'));
$args = array('label' => esc_html__(' ', 'jannahchild'), 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'rewrite' => array('slug' => 'dlb_type', 'with_front' => true), 'show_admin_column' => true, 'show_in_rest' => true, 'show_tagcloud' => false, 'rest_base' => 'dlb_type', 'rest_controller_class' => 'WP_REST_Terms_Controller', 'rest_namespace' => 'wp/v2', 'show_in_quick_edit' => false, 'sort' => false, 'show_in_graphql' => false);
register_taxonomy('dlb_type', array('diavouleusi'), $args);
}
goto ddMAG;
I0JJi:
function update_start_date($value, $post_id, $field)
{
$start_date = strtotime(get_field('start_date', $post_id));
$old_value = date('Y-m-d H:i:s', $start_date);
$new_value = $_POST['acf']['field_60b724c57d1b9'];
if ($old_value != $new_value) {
error_log('START DATE changed from ' . $old_value . ' to ' . $new_value . ' timestamp: ' . strtotime($new_value));
$timezone = 'Europe/Athens';
$new_date = new DateTime($new_value, new DateTimeZone($timezone));
$new_timestamp = $new_date->format('U');
$old_timestamp = wp_next_scheduled('schedule_diavouleusi_start');
error_log('Existing schedule: ' . $old_timestamp);
if ($old_timestamp) {
error_log('Unscheduling event');
wp_unschedule_event($old_timestamp, 'schedule_diavouleusi_start', array($post_id));
}
wp_schedule_single_event($new_timestamp, 'schedule_diavouleusi_start', array($post_id));
} else {
error_log('START DATE didnt change');
}
return $value;
}
goto BPvyy;
gigZQ:
function has_correct_comment_status($diav_id)
{
$diav_status = get_diavouleusi_status($diav_id);
$diav_post = get_post($diav_id);
$comment_status = $diav_post->comment_status;
if ($diav_status == 'Active') {
if ($comment_status == 'closed') {
return false;
}
return true;
} else {
if ($comment_status == 'open') {
return false;
}
return true;
}
}
goto qf2p2;
nb4GL:
function delete_diavouleusi_articles($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('Delete articles here');
$posts = get_diav_articles_bytag($post_id);
$count = 0;
if ($posts) {
foreach ($posts as $post) {
wp_delete_post($post->ID);
$count += 1;
}
} else {
$posts_trashed = get_diav_articles_bytag($post_id, true);
if ($posts_trashed) {
foreach ($posts_trashed as $post_t) {
wp_delete_post($post_t->ID);
$count += 1;
}
}
}
error_log('Articles deleted: ' . $count);
$tagname_todelete = get_diavouleusi_tagname($post_id);
$diav_tag = get_term_by('name', $tagname_todelete, 'post_tag');
if ($diav_tag) {
error_log('Term to delete: ' . $tagname_todelete . ' ID: ' . $diav_tag->term_id);
wp_delete_term($diav_tag->term_id, 'post_tag');
error_log('Term deleted');
}
}
goto rzM8F;
xQzbi:
add_filter('acf/fields/post_object/query/name=diavouleusi', 'filter_own_diavouleuseis', 10, 3);
goto US6aO;
h43LL:
function gnstl_profile_admin_css()
{
$screen_id = isset(get_current_screen()->id) ? get_current_screen()->id : null;
if ('profile' === $screen_id || 'user-edit' === $screen_id) {
wp_enqueue_style('profile-admin-css', '/wp-content/plugins/gnstl-deliberate/userprofile.css');
}
}
goto FAArC;
kSeDv:
add_shortcode('diavouleusi_resources', 'display_diavouleusi_resources');
goto XeIbK;
LCHm5:
function get_diavouleusi_rss_feed($diav_id)
{
$link = get_site_url() . '/feed?tag=' . get_diavouleusi_tagname($diav_id) . '&post_type=diavouleusi';
return $link;
}
goto gigZQ;
xaucG:
add_shortcode('diavouleusi_types', 'display_diavouleusi_types');
goto tCYtg;
MrpAk:
function display_diavouleusi_resources($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$resources = get_field_object('resources', $attributes['id']);
if ($resources) {
if (have_rows($resources['name'])) {
echo '<div class="diavouleusi-resources">';
echo '<h3 class="diav-heading"> </h3>';
echo '<ul>';
while (have_rows($resources['name'])) {
the_row();
$title = get_sub_field('title');
$file = get_sub_field('file');
$img = wp_get_attachment_image(get_sub_field('ID'));
$filetype = wp_check_filetype($file);
echo '<li><a href="' . $file . '" target="_blank" class="' . $filetype['ext'] . '">' . get_filetype_favicon($filetype['ext']) . ' ' . $title . '</a></li>';
}
echo '</ul>';
}
echo '</div>';
}
}
goto kSeDv;
ckDZM:
add_shortcode('articles_related', 'display_articles_related');
goto j6uLm;
z0j_6:
function update_diavouleusi_endtime_event($diav_id)
{
error_log('SCHEDULED Task UpdateEndTime executed for ' . $diav_id . ' @ ' . current_time('Y-m-d H:i:s'));
if (has_ended($diav_id)) {
update_diavouleusi_status($diav_id);
set_diavouleusi_comment_status($diav_id, 'closed');
} else {
error_log('Ignoring event');
}
}
goto YCYlT;
ghhd5:
function validate_num_articles($valid, $value, $field, $input_name)
{
if ($valid !== true) {
return $valid;
}
if ($_POST) {
if ($_POST['post_id'] != null) {
error_log('Getting numArticles via $_POST ' . $_POST['post_id']);
$posts = get_diav_articles_bytag($_POST['post_id']);
}
} else {
$currPost = get_post();
if ($currPost) {
$posts = get_diav_articles_bytagget_diav_articles_bytag($currPost->ID);
} else {
error_log('Error getting current post ID');
return;
}
}
$actualNumArticles = 0;
if ($posts) {
$actualNumArticles = sizeof($posts);
}
error_log('Line 688 Actual num: ' . $actualNumArticles);
foreach ($posts as $post) {
error_log('Post ID:: ' . $post->ID);
}
if ($actualNumArticles == 0) {
return $valid;
} else {
if ($value > $actualNumArticles) {
return __('Change number to ' . $actualNumArticles . ' or manually create ' . ($value - $actualNumArticles) . ' <a href="' . get_articles_link($_POST['post_id']) . '" target="_blank">article(s)</a>.');
} else {
if ($value < $actualNumArticles) {
return __('Change number to ' . $actualNumArticles . ' or manually delete ' . ($actualNumArticles - $value) . ' <a href="' . get_articles_link($_POST['post_id']) . '" target="_blank">article(s)</a>. <br/><em>Don't delete the <b>General comments</b> article.</em>');
} else {
return $valid;
}
}
}
}
goto VPhMM;
yGzF5:
function update_article_tag($field)
{
$post = get_post();
if ('article' !== get_post_type()) {
return $field;
}
$diav_id = $_POST['acf']['field_60bc93d67c929'];
if (!$diav_id) {
return $field;
}
error_log('DBG DiavID: ' . $diav_id);
$tag = get_diavouleusi_tagname($diav_id);
if ($tag) {
wp_set_post_tags($post->ID, array($tag), false);
}
error_log('Tags added');
connect_article_to_diav($post->ID, $diav_id);
error_log('Synced with diavouleusi');
return $field;
}
goto Tnu0E;
P1O7r:
add_action('untrash_post', 'untrash_diavouleusi_articles');
goto nb4GL;
rzM8F:
add_action('before_delete_post', 'delete_diavouleusi_articles');
goto Gp14y;
l5bPI:
add_filter('comments_clauses', 'gnstl_show_ownpost_comments');
goto Z2Lp0;
Tnu0E:
add_filter('acf/update_value/name=diavouleusi', 'update_article_tag');
goto v_sBd;
JJI4u:
add_shortcode('diavouleusi_intro_fields', 'display_diavouleusi_intro_fields');
goto MrpAk;
LzQsZ:
function update_end_date($value, $post_id, $field)
{
$end_date = strtotime(get_field('end_date', $post_id));
$old_value = date('Y-m-d H:i:s', $end_date);
$new_value = $_POST['acf']['field_60b725007d1ba'];
if ($old_value != $new_value) {
error_log('END DATE changed from ' . $old_value . ' to ' . $new_value . ' timestamp: ' . strtotime($new_value));
$timezone = 'Europe/Athens';
$new_date = new DateTime($new_value, new DateTimeZone($timezone));
$new_timestamp = $new_date->format('U');
$old_timestamp = wp_next_scheduled('schedule_diavouleusi_end');
error_log('Existing schedule: ' . $old_timestamp);
if ($old_timestamp) {
error_log('Unscheduling event');
wp_unschedule_event($old_timestamp, 'schedule_diavouleusi_end', array($post_id));
}
wp_schedule_single_event($new_timestamp, 'schedule_diavouleusi_end', array($post_id));
} else {
error_log('END DATE didnt change');
}
return $value;
}
goto UVsYJ;
yNeZU:
function display_diavouleusi_intro_fields($atts)
{
$attributes = shortcode_atts(array('id' => '', 'in_excerpt' => 1), $atts);
echo get_diavouleusi_intro_fields($attributes['id'], $attributes['in_excerpt']);
}
goto JJI4u;
bmO2b:
add_shortcode('diavouleusi_fields', 'display_diavouleusi_fields');
goto yNeZU;
Cprnd:
function connect_article_to_diav($article_id, $diav_id)
{
$article = get_post($article_id);
$diav = get_post($diav_id);
if (!$diav || !$article) {
error_log('No such post found');
return;
}
$numArticles = get_field('num_articles', $diav_id);
$update_args = array('ID' => $article_id, 'post_date' => $diav->post_date, 'post_status' => $diav->post_status, 'comment_status' => $diav->comment_status);
wp_update_post($update_args);
update_field('num_articles', $numArticles + 1, $diav_id);
}
goto lMN2H;
rTFJW:
add_shortcode('article_diav', 'display_article_diav');
goto iKUR3;
UVsYJ:
add_filter('acf/update_value/name=end_date', 'update_end_date', 10, 3);
goto yGzF5;
FAArC:
add_action('admin_enqueue_scripts', 'gnstl_profile_admin_css');
goto ESPZk;
X9xig:
function has_started($diav_id)
{
$curr_time = current_time('Y-m-d H:i:s');
$start_date = date('Y-m-d H:i:s', strtotime(get_field('start_date', $diav_id)));
if ($start_date > $curr_time) {
return false;
}
return true;
}
goto f3oJG;
YZtmr:
add_filter('acf/load_field/key=field_60e31013755bc', 'update_newstatus_field');
goto I0JJi;
eM3XR:
add_filter('pre_get_posts', 'gnstl_rss_feed');
goto ESXwZ;
PdbWc:
add_action('init', 'gnstl_register_my_cpts');
goto RuNcy;
YCkWN:
function update_diav_articles($diav_id, $post_date, $post_status, $comment_status)
{
$posts = get_diav_articles_bytag($diav_id);
$actualArticles = 0;
if ($posts) {
$actualArticles = sizeof($posts);
}
$expectedArticles = get_field('num_articles', $diav_id);
if ($actualArticles != $expectedArticles) {
return $actualArticles;
}
$update_args = array('ID' => 0, 'post_date' => $post_date, 'post_status' => $post_status, 'post_type' => 'article', 'post_title' => 'Article', 'post_name' => 'article', 'post_modified' => current_time('Y-m-d H:i:s'), 'post_content' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'comment_status' => $comment_status, 'ping_status' => '', 'post_password' => '', 'to_ping' => '', 'pinged' => '', 'post_parent' => '', 'menu_order' => '', 'post_mime_type' => '', 'guid' => '');
foreach ($posts as $post) {
$tmpPost = null;
$tmpPost = get_post($post->ID);
$update_args['ID'] = $post->ID;
$update_args['post_title'] = $tmpPost->post_title;
$update_args['post_name'] = $tmpPost->post_name;
$update_args['post_content'] = $tmpPost->post_content;
$update_args['post_content_filtered'] = $tmpPost->post_content_filtered;
$update_args['post_excerpt'] = $tmpPost->post_excerpt;
$update_args['ping_status'] = $tmpPost->ping_status;
$update_args['post_password'] = $tmpPost->post_password;
$update_args['to_ping'] = $tmpPost->to_ping;
$update_args['post_parent'] = $tmpPost->post_parent;
$update_args['menu_order'] = $tmpPost->menu_order;
$update_args['post_mime_type'] = $tmpPost->post_mime_type;
$update_args['guid'] = $tmpPost->guid;
$tmp = wp_insert_post($update_args);
update_field('diavouleusi', $diav_id, $post->ID);
}
return $actualArticles;
}
goto Cprnd;
Nouv2:
function get_diavouleusi_intro_fields($diav_id, $in_excerpt)
{
$status = get_diavouleusi_status($diav_id);
$diav_link = get_post_permalink($diav_id);
$rss_link = get_diavouleusi_rss_feed($diav_id);
$status_class = '';
$status_icon = '';
if ($status == 'Active' || $status == '') {
$status_text = '';
$status_class = '';
$status_icon = 'fa-unlock';
} else {
if ($status == 'In processing' || $status == ' ') {
$status_text = ' ';
$status_class = 'status-closed';
$status_icon = 'fa-lock';
} else {
if ($status == 'Completed' || $status == '') {
$status_text = '';
$status_class = 'status-complete';
$status_icon = 'fa-check-circle';
}
}
}
$val = '<div class="diavouleusi-info"><ul>';
$val .= '<li class="diavouleusi-status ' . $status_class . '"><i aria-hidden="true" class=" fas ' . $status_icon . '"></i>
<span>' . $status_text . '</span></li>';
$unixtimestamp = strtotime(get_field('start_date', $diav_id));
$start_date = date_i18n('d M Y @ G:i', $unixtimestamp);
$unixtimestamp2 = strtotime(get_field('end_date', $diav_id));
$end_date = date_i18n('d M Y @ G:i', $unixtimestamp2);
if ($in_excerpt) {
$start_pre = '<i aria-hidden="true" class="far fa-calendar-check"></i>';
$end_pre = '<i aria-hidden="true" class="far fa-calendar-times"></i>';
} else {
$start_pre = '<em></em><br/>';
$end_pre = '<em> </em><br/>';
}
$val .= '<li class="diavouleusi-date">' . $start_pre . ' <strong>' . $start_date . '</strong></li>';
$val .= '<li class="diavouleusi-date">' . $end_pre . ' <strong>' . $end_date . '</strong></li>';
if (!$in_excerpt) {
$val .= '<li class="emphasis"><i aria-hidden="true" class="fas fa-comments"></i> <span>' . get_diavouleusi_comment_count($diav_id) . ' </span></li>';
}
$val .= '</ul></div>';
$val .= '<div class="diavouleusi-actions"><ul>';
if ($status == 'Active' || $status == '') {
$val .= '<li><a class="button" href="' . $diav_link . '/' . '#articles' . '"><i aria-hidden="true" class="fas fa-comment-medical"></i> </a></li>';
}
$tmpCSV = generate_comments_csv($diav_id);
$action_status = '';
if (!$tmpCSV || $tmpCSV < 0) {
$val .= '<li><a class="button disabled" href="#"><em> </em></a></li>';
} else {
$val .= '<li><a class="button" href="' . $tmpCSV . '"><i aria-hidden="true" class="fas fa-file-export"></i> </a></li>';
}
if ($status != 'Completed') {
$val .= '<li><a class="button" href="' . $rss_link . '" target="_blank"><i aria-hidden="true" class="fas fa-rss"></i> </a></li>';
}
if ($status == 'Completed' && $in_excerpt) {
$val = $val . '<li><a class="button button-emphasis" href="' . $diav_link . '/#results"><i aria-hidden="true" class="fas fa-poll-h"></i> </a></li>';
}
$val .= '</ul></div>';
return $val;
}
goto us28k;
pPM4h:
function display_diavouleusi_fields($atts)
{
$attributes = shortcode_atts(array('id' => ''), $atts);
$fields = get_field_objects($attributes['id']);
if ($fields) {
echo '<ul>';
foreach ($fields as $field) {
if ($field['type'] != 'repeater') {
echo '<li><strong>' . $field['label'] . ':</strong> ' . $field['value'] . '</li>';
} else {
echo '<li><strong>' . $field['label'] . ':</strong>';
if (have_rows($field['name'])) {
echo '<ul>';
while (have_rows($field['name'])) {
the_row();
$title = get_sub_field('title');
$file = get_sub_field('file');
echo '<li><a href="' . $file . '" target="_blank">' . $title . '</a></li>';
}
echo '</ul>';
}
echo '</li>';
}
}
echo '</ul>';
}
}
goto bmO2b;
rkZHE:
add_filter('acf/load_field/key=field_60dc1e1cff1c5', 'update_article_link_field');
goto YgADs;
ZpOt9:
register_activation_hook(__FILE__, 'plugin_dependencies_activate');
goto h43LL;
eH5up:
function genestial_css()
{
echo '
<style type='text/css'>
#genestial {
float: right;
padding: 5px 10px;
margin: 0;
font-size: 12px;
line-height: 1.6666;
}
.rtl #genestial {
float: left;
}
.block-editor-page #genestial {
display: none;
}
@media screen and (max-width: 782px) {
#genestial,
.rtl #genestial {
float: none;
padding-left: 0;
padding-right: 0;
}
}
</style>
';
}
goto FLCb6;
JFiCQ:
function trash_diavouleusi_articles($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('Trash articles here');
$posts = get_diav_articles_bytag($post_id);
if ($posts) {
foreach ($posts as $post) {
wp_trash_post($post->ID);
}
}
error_log('Articles trashed');
}
goto LfuF0;
Lu60v:
function untrash_diavouleusi_articles($post_id)
{
global $post_type;
if ('diavouleusi' !== $post_type) {
return;
}
error_log('Untrash articles here');
$posts = get_diav_articles_bytag($post_id, true);
$count = 0;
if ($posts) {
foreach ($posts as $post) {
wp_untrash_post($post->ID);
$count += 1;
}
}
error_log('Articles untrashed: ' . $count);
}
goto P1O7r;
xM0gL:
function gnstl_rss_feed($query)
{
if ($query->is_feed()) {
$query->set('post_type', array('post', 'diavouleusi', 'article'));
}
return $query;
}
goto eM3XR;
ddMAG:
add_action('init', 'gnstl_register_my_taxes');
Function Calls
None |
Stats
MD5 | ccba0fb78edf22bcfe0495688a628004 |
Eval Count | 0 |
Decode Time | 82 ms |