Daniele Scasciafratte @Mte90Net - ConfSL
#ConfSL

Wordpress as a Framework 2.0

no longer only blog cms

By Daniele Scasciafratte based on Eugenio PetullĂ  slides

Daniele Scasciafratte

  • Co Founder Codeat - Full Stack Developer
  • Mozillian & Mozilla Reps & Participation Leader
  • Articolista per AndMore, ChimeraRevo e TechEconomy
  • Utente Debian Linux dal 2009
  • WordPress Contributor/Developer/Translator
  • Open Source Addicted
  • Industria Italiana Software Libero Vice President

forget what you know about wordpress

Filter Hook


function custom_excerpt_length( $length ) {
    return 30;
}

add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
                    

Action Hook


function modify_post_type_supports() {
    remove_post_type_support( 'pages', 'comments' );
}
                    
add_action( 'init', 'modify_post_type_supports', 11 ); 
                    

we just started!

Custom Post type

Create a custom post type


// Register Custom Post Type
function show() {
    $labels = array(
        'name'                => _x( 'Shows', 'Post Type General Name', 'file_language' ),
        'singular_name'       => _x( 'Show', 'Post Type Singular Name', 'file_language' ),
        'menu_name'           => __( 'Show', 'file_language' ),
        'name_admin_bar'      => __( 'Show', 'file_language' ),
        'parent_item_colon'   => __( 'Parent Item:', 'file_language' ),
        'all_items'           => __( 'All Items', 'file_language' ),
        'add_new_item'        => __( 'Add New Item', 'file_language' ),
        'add_new'             => __( 'Add New', 'file_language' ),
        'new_item'            => __( 'New Item', 'file_language' ),
        'edit_item'           => __( 'Edit Item', 'file_language' ),
        'update_item'         => __( 'Update Item', 'file_language' ),
        'view_item'           => __( 'View Item', 'file_language' ),
        'search_items'        => __( 'Search Item', 'file_language' ),
        'not_found'           => __( 'Not found', 'file_language' ),
        'not_found_in_trash'  => __( 'Not found in Trash', 'file_language' ),
        );
    $args = array(
        'label'               => __( 'show', 'file_language' ),
        'description'         => __( 'Show Description', 'file_language' ),
        'labels'              => $labels,
        'supports'            => array( 'title', 'editor', 'thumbnail', 'comments', ),
        'taxonomies'          => array( 'portfolio_category' ),
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'menu_position'       => 5,
        'show_in_admin_bar'   => true,
        'show_in_nav_menus'   => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'page',
        );
    register_post_type( 'show', $args );
}
// Hook into the 'init' action
add_action( 'init', 'show', 0 );
                    

Media manager

Native API Integrated

  • Widgets
  • Options/Settings
  • Quicktags (TinyMCE)
  • Shortcode
  • Transients
  • Metadata
  • oEmbed
  • Cron
  • Rewrite
  • Pointer
  • Heartbeat
  • Multisite
  • .po, .mo support

Hack, Percona DB, MariaDB, MemCache, Varnish, Nginx, CDN, PageSpeed, WP CLI

The end