register(); } register_activation_hook( __FILE__, array( $AddToCalendarAtccf7, 'activate' ) ); $get_page = ( isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '' ); if ( is_admin() && ( isset( $get_page ) && ( $get_page === 'wpcf7' || $get_page === 'wpcf7-new' ) ) ) { require_once dirname( __FILE__ ) . '/admin-atc.php'; } add_action( 'wpcf7_contact_form', 'atccf7_enqueue_scripts', 20, 99 ); function atccf7_enqueue_scripts( $form ) { if ( is_admin() ) { return; } wp_enqueue_style( 'atccf7-styles', plugins_url( '/frontend/css/styles.css', __FILE__ ) ); wp_enqueue_script( 'atccf7-scripts', plugins_url( '/frontend/js/scripts.js', __FILE__ ) ); $postmeta_temp = get_post_meta( $form->id(), 'atccf7_options_form', true ); $postmeta_atc = ( $postmeta_temp !== '' ? $postmeta_temp : false ); if ( $postmeta_atc ) { wp_localize_script( 'atccf7-scripts', 'atccf7_options_form', $postmeta_atc ); } }