Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author apasionados

    (@apasionados)

    Hi @mengsel,

    Unfortunately we can’t restore the custom CSS functionality as the WordPress Plugin Team requested us to remove it as a potential security risk. They want custom CSS to be saved in the Customizer.

    Here is more information about why we had to remove it:

    We no longer permit arbitrary plugins to allow users to save custom CSS, JavaScript, or PHP within the plugin. The primary reason for this is that WordPress includes it’s own, robust, error-checking, CSS editor in the Customizer already. Any time your plugin replicates functionality found in WordPress (i.e. the uploader, jquery) is frowned upon, as it presents a possible security risk. The features in WordPress have been tested by many more people than use most plugins, so the built in tools are less likely to have issues.

    Sorry for the inconvenience.

    Best regards from Spain.

    Hi @apasionados. I applied the same old CSS to Customizer but nothing changes.

    Plugin Author apasionados

    (@apasionados)

    We just checked and the Customizer only applies the CSS styles to the frontend. There is no way to add CSS styles to the admin. We will ask the plugin repository support on how to handle this situation.

    Best regards from Spain

    Thread Starter mengsel

    (@mengsel)

    According to https://codex.wordpress.org/Customizing_the_Login_Form you’re probably best off persisting the input into a CSS file that is enqueued as follows:

    function my_login_stylesheet() {
        wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/style-login.css' );
        wp_enqueue_script( 'custom-login', get_stylesheet_directory_uri() . '/style-login.js' );
    }
    add_action( 'login_enqueue_scripts', 'my_login_stylesheet' );

    Alternatively, you could output the additional styles into the same style section that is suggested to use in order to change the logo:

    function my_login_logo() { ?>
        <style type="text/css">
            #login h1 a, .login h1 a {
                background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/site-login-logo.png);
    		height:65px;
    		width:320px;
    		background-size: 320px 65px;
    		background-repeat: no-repeat;
            	padding-bottom: 30px;
            }
        </style>
    <?php }
    add_action( 'login_enqueue_scripts', 'my_login_logo' );
    Plugin Author apasionados

    (@apasionados)

    Hi @mengsel,

    The problem with the solutions you mention is that they can’t be customized as now we can’t include a field in the plugin settings to introduce custom CSS. Maybe we are missing something but we have not found a solution at this moment.

    Best regards from Spain.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘No more custom CSS’ is closed to new replies.