Respuestas de foro creadas

Viendo 5 respuestas - de la 1 a la 5 (de un total de 5)
  • Iniciador del debate gigasize777

    (@gigasize777)

    Si en efecto no se esta usando «login_enqueue_scripts» pero asi lo borre no cambia nada sigue sin funcionar lo que quiero es llamar la funcion «my_custom_login_stylesheet» adentro de ese IF, ese es todo el codigo que tengo

    Iniciador del debate gigasize777

    (@gigasize777)

    aqui te pongo el codigo completo:

    <?php
    
    function my_custom_login_stylesheet() {?>
                     <style type="text/css">
                     
                     body.login div#login p#backtoblog {
    display: none;
                     }
    
       
       </style>
                  <?php 
                  
                     }
    
    defined( 'ABSPATH' ) || exit;
            
    if ( ! class_exists( 'MP_Test_Plugin' ) ) :
    
        class MP_Test_Plugin {
    
            public function __construct() {
              
                add_action( 'admin_menu', array( $this, 'setup_menu' ) );
                add_action( 'admin_init', array( $this, 'register_options' ) );
    
            }
            
            public function setup_menu() {
                           add_menu_page( 'Test Plugin Page', 'Test Plugin', 'manage_options', 'test-plugin', array( $this, 'test_menu_page' ), 'dashicons-smiley' );
            }
    
            public function test_menu_page() { 
            
            
                if ( isset( $_POST['option_page'] ) && $_POST['option_page'] == 'mp_settings_group' ) {
                    if ( isset( $_POST['test_init'] ) ) {
                        update_option( 'test_init', 'yes' );
                    } else {
                        update_option( 'test_init', 'no' );
                    }
                }
                
     
                              
                
                $test_option = get_option( 'test_init', 'no' );
                ?>
                <div class="wrap">
                    <h1>Plugin</h1>
                    <form method="post"> 
                        <?php settings_fields( 'mp_settings_group' ); ?>
                        <?php do_settings_sections( 'mp_settings_group' ); ?>
                        <input type="checkbox" name="test_init" value="<?php echo $test_option; ?>" <?php checked( $test_option, 'yes' ); ?> id="test_init" /><label for="test_init"> Activado?</label>
                            <?php submit_button(); ?>
                    </form>
                </div>
    
                <?php
                
                if ( $test_option == 'yes' ) { 
                    echo 'Activado'; 
                                  
            add_action( 'login_enqueue_scripts', 'my_custom_login_stylesheet' );   
    
                    
                } 
                
                
                else {
                    echo 'Desactivado';
                }
                
            }
    
            public function register_options() {
                register_setting( 'mp_settings_group', 'test_init' ); 
            } 
        }
        
    endif;
    
    if ( is_admin() ) { 
        new MP_Test_Plugin();
    }
    Iniciador del debate gigasize777

    (@gigasize777)

    Si solo busco modificar el login, aqui te dejo el codigo IF

     <?php
                
                if ( $test_option == 'yes' ) { 
                    echo 'Encendido'; 
    
        add_action( 'login_enqueue_scripts', 'my_custom_login_stylesheet' );
                                                      
                } 
                
    
                
                else {
                    echo 'Apagado';
                }
                
            }
    
    Iniciador del debate gigasize777

    (@gigasize777)

    Si lo lei pero no me funciona me redirige hacia options.php, ando enredado, le he agregado

    function settings_page()
    {

    register_option_in_db(«test_init»);
    }

    pero me sigue sin funcionar

    Iniciador del debate gigasize777

    (@gigasize777)

    No me sirvio me redirige a «wp-admin/options.php»

Viendo 5 respuestas - de la 1 a la 5 (de un total de 5)