mycred_setup_addons

Codex / mycred/core / Filters / mycred_setup_addons

Navigation:

  1. Description
  2. Used By
  3. Parameters
  4. Examples

Description

This filter allows you to register your own add-ons or remove/disable existing add-ons.

 

Used By

  • Class: myCRED_Addons Method: get()

 

Parameters

  • installed (array)
    Associative array of installed add-ons.

 

Examples

Example 1: Add a custom add-on.

<?php
add_filter( 'mycred_setup_addons', 'add_my_custom_addon' );
function add_my_custom_addon( $installed )
{
	$installed['plugin-folder-name'] = array(
		'title'       => __( 'My Custom Addon' ),
		'addon_uri'   => 'http://myaddon.com/',
		'version'     => '1.0',
		'description' => 'My custom add-on description.',
		'author'      => 'My Name',
		'author_uri'  => 'http://mywebsite.com',
		'file'        => 'the-file-to-include.php',
		'folder'      => 'wp-content/plugins/plugin-folder-name/',
	);

	return $installed;
}
?>

Example 2: Remove the “BuddyPress” Add-on.

<?php
add_filter( 'mycred_setup_addons', 'remove_an_addon' );
function remove_an_addon( $installed )
{
	unset( $installed['buddypress'] );
	return $installed;
}
?>

Last edited June 26, 2016