Skip to content

Instantly share code, notes, and snippets.

View catlauraherzog's full-sized avatar

Laura catlauraherzog

  • Concepts & Training
  • Solingen / Germany
View GitHub Profile
@catlauraherzog
catlauraherzog / filter_the_title.php
Last active August 29, 2015 14:09
filter_the_title
<?php
/**
* Filter the post title.
*
* @since 0.71
*
* @param string $title The post title.
* @param int $id The post ID.
*/
return apply_filters( 'the_title', $title, $id );
@catlauraherzog
catlauraherzog / filter_arguments.php
Last active August 29, 2015 14:09
Filter Description
<?php
* @param string $tag The name of the filter to hook the $function_to_add callback to.
* @param callback $function_to_add The callback to be run when the filter is applied.
* @param int $priority (optional) The order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
* Default 10.
* @param int $accepted_args (optional) The number of arguments the function accepts.
* Default 1.
?>
@catlauraherzog
catlauraherzog / wp_head.php
Last active August 29, 2015 14:09
Über Hooks und Funktionen in WordPress - wp_head
<?php
/**
* This function loads all themes files,
* registers the actions and filters which are
* needed to get this theme on work. It also
* registers the needed language packs and its
* textdomain.
*
* @wp-hook after_setup_theme
* @return void
@catlauraherzog
catlauraherzog / wpc_my_plugin_name_init.php
Last active August 29, 2015 14:09
Über Hooks und Funktionen in WordPress - wpc_my_plugin_name_init
<?php
/**
* This function loads all plugin files,
* registers the actions and filters which are
* needed to get this plugin on work. It also
* registers the needed language packs and its
* textdomain.
*
* @wp-hook plugins_loaded
* @return void
@catlauraherzog
catlauraherzog / add_action.php
Last active August 29, 2015 14:08
Über Hooks und Funktionen in WordPress - add_action
<?php
/**
* Hooks a function on to a specific action.
*
* Actions are the hooks that the WordPress core launches at specific points
* during execution, or when specific events occur. Plugins can specify that
* one or more of its PHP functions are executed at these points, using the
* Action API.
*
* @uses add_filter() Adds an action. Parameter list and functionality are the same.
@catlauraherzog
catlauraherzog / after_setup_theme.php
Last active August 29, 2015 14:08
Über Hooks und Funktionen in WordPress - after_setup_theme
<?php
/**
* Fires after the theme is loaded.
*
* @since 3.0.0
*/
do_action( 'after_setup_theme' );
?>
@catlauraherzog
catlauraherzog / plugins_loaded.php
Last active August 29, 2015 14:08
Über Hooks und Funktionen in WordPress - plugins_loaded
<?php
/**
* Fires once activated plugins have loaded.
*
* Pluggable functions are also available at this point in the loading order.
*
* @since 1.5.0
*/
do_action( 'plugins_loaded' );
?>
@catlauraherzog
catlauraherzog / ll_get_role_of_user.php
Last active August 29, 2015 14:08
ll_get_role_of_user()
<?php
/**
* this function gets the role of the given
* user
*
* @param id the id of the user
* @return string role of user
*/
function ll_get_role_of_user( $user_id ) {