Wordpress

Toolset: Select2

jQuery(document).ready(function() {
    jQuery('#desplegabledir select').select2();
});

Añadir select2 en un desplegable de toolset. Els desplegable tiene id y css class desplegabledir.

<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>

Toolset: Select2 Leer más »

WordPress: Agregar efecto de mouseover al bloque Gutenberg en WordPress

.shadow-with-mouse-over-effect {
    background: #efefef;
    box-shadow: 0 0 17px 0 rgba(0,0,0,0.06);
    margin-bottom: 30px;
    transition: .3s;
}

.shadow-with-mouse-over-effect:hover {
    box-shadow: 0 20px 25px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

Visto en https://myknowledgeportal.com/2019/01/09/add-mouseover-effect-to-gutenberg-block-in-wordpress/

WordPress: Agregar efecto de mouseover al bloque Gutenberg en WordPress Leer más »

How to change Contact Form 7 Placeholder Text Color

::-webkit-input-placeholder { /* WebKit browsers */
    color: #000 !important;
    opacity: 1;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color: #000 !important;
    opacity: 1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
    color: #000 !important;
    opacity: 1;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
    color: #000 !important;
    opacity: 1;
}

Visto en https://codeless.co/contact-form-7-placeholder-text-color/

How to change Contact Form 7 Placeholder Text Color Leer más »

Mostrar campos de usuario en la columna del administrador

function new_modify_user_table( $column ) {
    $column['test-1'] = 'test 1';
    $column['test-2'] = 'test 2';
    return $column;
}
add_filter( 'manage_users_columns', 'new_modify_user_table' );
 
function new_modify_user_table_row( $val, $column_name, $user_id ) {
    switch ($column_name) {
        case 'test-1' :
            return get_user_meta($user_id, 'wpcf-test-1', true);
        case 'test-2' :
            return get_user_meta($user_id, 'wpcf-test-2', true);
        default:
    }
    return $val;
}
add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );

Visto en toolset

Mostrar campos de usuario en la columna del administrador Leer más »

Working with the WordPress user meta query

$args = array(
    'meta_query' => array(
        'relation' => 'AND',
            array(
                'key'     => 'occupation',
                'value'   => 'developer',
                 'compare' => 'LIKE' // any value that contains developer
            ),
            array(
                'key'     => 'billing_country',
                'value'   => 'United States',
                 'compare' => '='
            ),
            array(
                'key'     => 'experience',,
                'value'   => '5',
                 'compare' => '>='
            )
    )
);
 
$user_query = new WP_User_Query( $args );

Visto en https://usersinsights.com/wordpress-user-meta-query/

Working with the WordPress user meta query Leer más »

WordPress: Inhabilitar mostrar entradas y medios de otros usuarios

add_action('pre_get_posts', 'query_set_only_author' );
function query_set_only_author( $wp_query ) {
 global $current_user;
 if( is_admin() && !current_user_can('edit_others_posts') ) {
    $wp_query->set( 'author', $current_user->ID );
    add_filter('views_edit-post', 'fix_post_counts');
    add_filter('views_upload', 'fix_media_counts');
 }
}

Visto en Collectiveray

WordPress: Inhabilitar mostrar entradas y medios de otros usuarios Leer más »

WordPress: Bloquear wp-admin a no administradores

/**
 * Hide admin bar for non-admins
 */
function js_hide_admin_bar( $show ) {
	if ( ! current_user_can( 'administrator' ) ) {
		return false;
	}

	return $show;
}
add_filter( 'show_admin_bar', 'js_hide_admin_bar' );

/**
 * Block wp-admin access for non-admins
 */
function ace_block_wp_admin() {
	if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
		wp_safe_redirect( home_url() );
		exit;
	}
}
add_action( 'admin_init', 'ace_block_wp_admin' );

WordPress: Bloquear wp-admin a no administradores Leer más »

Scroll al inicio

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.