abspath(), $file); apollo13framework_enable_user_css_functions(); $css = apollo13framework_get_user_css(); $wp_filesystem->put_contents( $file, $css, FS_CHMOD_FILE ); //remove any pending update request update_option('a13_user_css_update','off'); } } //we couldn't save else{ update_option('a13_user_css_update','on'); } if($hide_errors){ ob_end_clean(); } } if( is_admin() ){ add_action( 'after_setup_theme', 'a13fe_check_user_css' ); } /** * If file system is not in direct mode, we need to ask for FTP creds to create user.css file * * @since 1.4.0 */ function a13fe_check_user_css(){ if(get_option('a13_user_css_update') === 'on'){ add_action( 'admin_notices', 'a13fe_notice_about_user_css', 0 ); } } /** * Displays FTP form in case of wrong permission or ownership to user directory * * @since 1.4.0 */ function a13fe_notice_about_user_css(){ echo '
'. sprintf( /* translators: %s: user CSS file name */ esc_html__( 'Creating the %s file(responsible for the theme settings) requires access to your FTP account. This is due to the configuration of your server.', 'apollo13-framework-extensions' ), ''.esc_html( a13fe_user_css_name() ).'' ). '
'; //this will cause form from WP_Filesystem to display do_action( 'apollo13framework_generate_user_css', false ); echo '