This file contains 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
class MYCP_Buy_Featured extends APP_View { | |
function condition() { | |
return is_singular( APP_POST_TYPE ) && ! empty( $_GET['buy_featured'] ); | |
} | |
function template_redirect() { | |
appthemes_require_login( array( | |
'login_text' => __( 'You must first login to feature ad listing.', APP_TD ), | |
'login_register_text' => __( 'You must first login or <a href="%s">register</a> to feature ad listing.', APP_TD ) |
This file contains 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
function childtheme_allow_pdf_files( $config ) { | |
$config['plupload']['filters']['extensions'] = 'jpg,jpeg,gif,png,pdf'; | |
return $config; | |
} | |
add_filter( 'appthemes_plupload_config', 'childtheme_allow_pdf_files', 10, 1 ); | |
add_filter( 'app_plupload_config', 'childtheme_allow_pdf_files', 10, 1 ); // legacy, pre CP 3.4 |
This file contains 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 | |
/** | |
* Class that validate and retrieve data from PESEL number in object-oriented style | |
* | |
* Example: | |
* $pesel = new Pesel('85042510356'); | |
* $pesel->getBirthday()->format("d-m-Y") | |
* $pesel->getSex() | |
* $pesel->getAge("%a") |
This file contains 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
function childtheme_add_ads_to_search() { | |
if ( ! is_search() ) | |
return; | |
// display ads | |
cp_adbox_336x280(); | |
} | |
add_action( 'appthemes_before_loop', 'childtheme_add_ads_to_search' ); // before listings | |
add_action( 'appthemes_after_loop', 'childtheme_add_ads_to_search' ); // after listings |
This file contains 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
function childtheme_remove_theme_supports() { | |
remove_theme_support( 'ticket-milestones' ); | |
remove_theme_support( 'ticket-assignment' ); | |
} | |
add_action( 'after_setup_theme', 'childtheme_remove_theme_supports', 11 ); |
This file contains 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 childtheme_duplicate_check_of_id_field( $post_meta ) { | |
global $wpdb; | |
foreach ( $post_meta as $meta_key => $meta_value ) { | |
if ( $meta_key == 'clpr_id' && ! empty( $meta_value ) ) { | |
$sql = $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'clpr_id' AND meta_value = %s", $meta_value ); | |
if ( $wpdb->get_var( $sql ) ) { | |
$post_meta[ $meta_key ] = 'delete_this_post'; |
This file contains 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
function childtheme_remove_theme_supports() { | |
remove_theme_support( 'app-login' ); | |
} | |
add_action( 'appthemes_init', 'childtheme_remove_theme_supports' ); |
This file contains 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
function childtheme_remove_deprecated_files() { | |
if ( file_exists( get_stylesheet_directory() . '/some-file.php' ) ) { | |
unlink( get_stylesheet_directory() . '/some-file.php' ); | |
} | |
} | |
add_action( 'appthemes_first_run', 'childtheme_remove_deprecated_files' ); |
This file contains 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
function childtheme_block_wp_admin() { | |
if ( ! current_user_can( 'manage_options' ) && ! defined( 'DOING_AJAX' ) ) { | |
wp_redirect( home_url( '/' ) ); | |
} | |
} | |
add_action( 'admin_init', 'childtheme_block_wp_admin' ); |