This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Function to log filters, actions and other parts of the website, that are processed in backend | |
| * Usage theme_log('Log me'); | |
| * | |
| * @param (array|string) $log | |
| * @return false | |
| */ | |
| function vk_theme_log($log) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Documentation: https://www.advancedcustomfields.com/resources/acf-save_post/ | |
| add_action('acf/save_post', 'vk_acf_save_post', 5); | |
| function vk_acf_save_post( $post_id ) { | |
| //Bail if post type is not equal "tickets" | |
| if ( get_post_type( $post_id ) != 'tickets' ) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function list_pages_func( $atts ) { | |
| $a = shortcode_atts( array( | |
| 'type' => 'pages', | |
| 'id' => '', | |
| ), $atts ); | |
| $args = array( | |
| 'post_type' => $a['pages'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function read_csv($file_path,$delimiter) { | |
| $csv_rows = array(); | |
| $fp = fopen($file_path, 'r'); | |
| $head = fgetcsv($fp, 4096, $delimiter, '"'); | |
| // Rows | |
| while($column = fgetcsv($fp, 4096, $delimiter, '"')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //In functions | |
| add_action( 'init', 'rewrite_plays_url' ); | |
| function rewrite_plays_url() { | |
| add_rewrite_rule( 'program/([^/]+)/([^/]+)/([^/]+)?$','index.php?page_id=1&rok=$matches[1]&mesic=$matches[2]&misto=$matches[3]', 'top' ); | |
| add_rewrite_rule( 'program/([^/]+)/([^/]+)?$','index.php?page_id=1&rok=$matches[1]&mesic=$matches[2]', 'top' ); | |
| add_rewrite_rule( 'program/([^/]+)?$','index.php?page_id=1&rok=$matches[1]', 'top' ); | |
| } | |
| add_filter( 'query_vars', 'register_custom_query_vars', 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Query that search wp_posts table for title with defined cpt, taxonomy and taxonomy term ID | |
| */ | |
| global $wpdb; | |
| $table_name = "{$wpdb->prefix}posts"; | |
| //Define post type | |
| $post_type = "cpt"; | |
| //Define taxonomy and term_ID |