File: //proc/1526/task/1530/cwd/vcz/wp-content/plugins/volonteka-site-plugin/index.php
<?php
/*
Plugin Name: VCZ Site Plugin
Plugin URI: https://borealis.agency/
Description: The site plugin for VCZ Site containing custom post types, custom fields and specific features
Version: 1.0
Author: Borealis
Author URI: https://borealis.agency/
Text Domain: vcz
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
require_once( 'acf-json.php' );
require_once( 'rest-api.php' );
/* Theme settings options page */
add_action( 'acf/init', function(){
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => __( 'Theme settings', 'volonteka_theme' ),
'menu_title' => __( 'Theme settings', 'volonteka_theme' ),
'menu_slug' => 'theme-settings',
));
}
});
// Hide posts that are in excluded category from posts listings
add_filter('pre_get_posts', function($query) {
if ( $query->is_home() ) {
$query->set('cat', "-" . get_field('excluded_category', 'option'));
}
return $query;
});