Wiki 42

Search
Skip to content

Monthly Archives: May 2015

Wordpress

Block users from wp-admin

2015-05-22 Tomislav Vlahović Leave a comment
add_action( 'init', 'blockusers_init' );

function blockusers_init() {
    if ( is_admin() && ! current_user_can( 'administrator' ) && 
       ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
        wp_redirect( home_url() );
        exit;
    }
}

 

JavaScript

bind event to document

2015-05-06 Tomislav Vlahović Leave a comment
$(document).on('click', '.add_photo_to_location', function(){
  $('#upload-modal').modal();
});

 

dz42 Wiki & Knowledge Base

Recent Posts

  • Move WordPress to a New Domain Without Losing SEO
  • Sublime preferences
  • 2016 – Books read
  • Defeat annoying copy&paste blockers
  • msql is in bounds search

Recent Comments

    Archives

    • November 2016
    • January 2016
    • November 2015
    • October 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • December 2014
    • November 2014
    • October 2014
    • September 2014
    • August 2014
    • July 2014
    • June 2014
    • May 2014
    • April 2014
    • March 2014
    • February 2014
    • January 2014
    • November 2013
    • October 2013
    • September 2013
    • August 2013
    • July 2013
    • June 2013
    • May 2013
    • April 2013
    • March 2013
    • February 2013
    • January 2013

    Categories

    • Asp
    • Bookmarks
    • Books
    • Django
    • Docker
    • ExtJS
    • Facebook API
    • Geek
    • Graphics
    • JavaScript
    • jQuery
    • Linux
    • Modding
    • MySql
    • PHP
    • PostgreSQL
    • Python
    • Sublime
    • Uncategorized
    • Windows
    • Wordpress

    Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
    Proudly powered by WordPress