Skip to content

Changing the plugin's name

Michael Eisenwasser edited this page Feb 11, 2020 · 29 revisions

Table of Contents

Plugin Name

The first thing you will want to do after forking or downloading the plugin, is to change the plugin's name to make it your own, and to make sure its functions and classes do not conflict with any other plugins.

You will start by opening the file buddyboss-platform-addon.php and editing the intro details to match your own Plugin Name, Plugin URI, Description, Author, Author URI, and Text Domain:

/**
 * Plugin Name: BuddyBoss Platform Add-on
 * Plugin URI:  https://buddyboss.com/
 * Description: Example plugin to show developers how to add their own settings into BuddyBoss Platform.
 * Author:      BuddyBoss
 * Author URI:  https://buddyboss.com/
 * Version:     1.0.0
 * Text Domain: buddyboss-platform-addon
 * Domain Path: /languages/
 * License:     GPLv3 or later (license.txt)
 */

You will also need to change the text 'BuddyBoss Platform Add-on' to your plugin's name, in the below functions of the same file. These functions provide an error notice if the website is not running BuddyBoss Platform or is running a version lower than 1.2.6. More info here.

function MYPLUGIN_BB_Platform_install_bb_platform_notice() {
	echo '<div class="error fade"><p>';
	_e('<strong>BuddyBoss Platform Add-on</strong></a> requires the BuddyBoss Platform plugin to work. Please <a href="https://buddyboss.com/platform/" target="_blank">install BuddyBoss Platform</a> first.', 'buddyboss-platform-addon');
	echo '</p></div>';
}

function MYPLUGIN_BB_Platform_update_bb_platform_notice() {
	echo '<div class="error fade"><p>';
	_e('<strong>BuddyBoss Platform Add-on</strong></a> requires BuddyBoss Platform plugin version 1.2.6 or higher to work. Please update BuddyBoss Platform.', 'buddyboss-platform-addon');
	echo '</p></div>';
}

File Names

You will need to edit the following file and folder names to match your plugin naming scheme:

/buddyboss-platform-addon/
buddyboss-platform-addon.php

Function Names

You will need to have unique function and class names to match your plugin. We have made this easy for you by adding the prefix MYPLUGIN_ in every instance that needs to be changed. You can just copy/paste a new prefix over all of these instances and you should be done. You can find all instances in the following PHP files:

buddyboss-platform-addon.php
functions.php
/integration/buddyboss-addon-integration-tab.php
/integration/buddyboss-integration.php

You will also need to replace the class names including MYPLUGIN_ in the following CSS file:

style.css

Text Domain

You will need to use your own text domain, for allowing all text instances in your plugin to be available for translation. The default text domain is buddyboss-platform-addon. You will need to edit all instances of this text domain, replacing it with your own. You can find all instances in the following files:

buddyboss-platform-addon.php
functions.php
/integration/buddyboss-integration.php