Skip to content

Instantly share code, notes, and snippets.

<?php
add_action( 'after_setup_theme', 'theme_start_content' );
function theme_starter_content() {
add_theme_support( 'starter-content', array(
'widgets' => array(
'sidebar-1' => array(
'text_business_info',
'search',
array(
<?php
class Mein_Widget extends WP_Widget {
function __construct() {
// Instantiate the parent object
parent::__construct( 'meine-base-id', _x( 'My widget', 'theme-slug' ) );
}
function widget( $args, $instance ) {
<?php
add_action( 'after_setup_theme', 'theme_start_content' );
function theme_starter_content() {
add_theme_support( 'starter-content', array(
'posts' => array(
'home',
'test' => array(
'post_type' => 'page',
<?php
add_action( 'after_setup_theme', 'theme_start_content' );
function theme_starter_content() {
add_theme_support( 'starter-content', array(
'posts' => array(
'home',
'test' => array(
'post_type' => 'page',
<?php
add_theme_support( 'starter-content', array(
'attachments' => array(
'featured-image-logo' => array(
'post_title' => 'Featured Logo',
'post_content' => 'Attachment Description',
'post_excerpt' => 'Attachment Caption',
'file' => 'assets/images/featured-logo.jpg',
),
),
<?php
add_action( 'after_setup_theme', 'theme_start_content' );
function theme_starter_content() {
add_theme_support( 'starter-content', array(
'posts' => array(
'home',
'about',
'contact',
<?php
add_action( 'after_setup_theme', 'theme_start_content' );
function theme_starter_content() {
add_theme_support( 'starter-content', array(
'posts' => array(
'test' => array(
'post_type' => 'page',
'post_title' => _x( 'Das ist ein Test', 'theme-slug' ),
<?php
add_action( 'after_setup_theme', 'theme_start_content' );
function theme_starter_content() {
add_theme_support( 'starter-content', array(
'widgets' => array(
'sidebar-1' => array(
'text_business_info',
'search',
),
@websupporter
websupporter / rest-api-nonces.php
Created January 18, 2017 11:57
Example Script for my blog post on Nonces in the REST API
<?php
/**
* Plugin Name: Nonces in der REST API
* Author: Websupporter
* Plugin URL: http://websupporter.net/blog/de/nonces-in-der-rest-api/
* Licence: GPL
**/
@websupporter
websupporter / rest-api-nonces-not-working.php
Created January 18, 2017 11:56
Example Code for my blog post of REST API and Nonces
<?php
/**
* Plugin Name: Nonces in der REST API Not working
* Author: Websupporter
* Plugin URL: http://websupporter.net/blog/de/nonces-in-der-rest-api/
* Licence: GPL
**/
add_action( 'wp_ajax_nonce-test', 'ajax_nonce_test' );