Can anyone help me write up the remove_action snippet for

Can anyone help me write up the remove_action snippet for the following code?

if(!function_exists('themify_manage_builder')) {
	/**
	 * Builder Settings
	 * @param array $data
	 * @return string
	 * @since 1.2.7
	 */
	function themify_manage_builder($data=array()) {
		global $ThemifyBuilder;
		$data = themify_get_data();
		$pre = 'setting-page_builder_';
		$output = '';
		$modules = $ThemifyBuilder->get_modules();

		foreach ($modules as $m) {
			$exclude = $pre.'exc_'.$m['name'];
			$checked = isset($data[$exclude]) ? 'checked="checked"' : '';
			$output .= '<p>
						<span><input id="builder_module_'.$m['name'].'" type="checkbox" name="'.$exclude.'" value="1" '.$checked.'/> <label for="builder_module_'.$m['name'].'">' . sprintf(__('Exclude %s module', 'themify'), ucfirst($m['name']) ) . '</label></span>
					</p>';
		}

		return $output;
	}
}
  • Vaughan

    Hi @Fla0,

    Do you mean you want to create your own function to replace the one you posted?

    If so, then there is no need for a remove_action in this case,

    The function above is surround by a condition to detect if that function already exists.

    if(!function_exists('themify_manage_builder')) {

    Therefore the only thing you need to do is copy the function itself & edit it how you please.

    so just add the following to your theme functions.php

    /**
    	 * Builder Settings
    	 * @param array $data
    	 * @return string
    	 * @since 1.2.7
    	 */
    	function themify_manage_builder($data=array()) {
    
            // Change all the code you want inside here
    
    		global $ThemifyBuilder;
    		$data = themify_get_data();
    		$pre = 'setting-page_builder_';
    		$output = '';
    		$modules = $ThemifyBuilder->get_modules();
    
    		foreach ($modules as $m) {
    			$exclude = $pre.'exc_'.$m['name'];
    			$checked = isset($data[$exclude]) ? 'checked="checked"' : '';
    			$output .= '<p>
    						<span><input id="builder_module_'.$m['name'].'" type="checkbox" name="'.$exclude.'" value="1" '.$checked.'/> <label for="builder_module_'.$m['name'].'">' . sprintf(__('Exclude %s module', 'themify'), ucfirst($m['name']) ) . '</label></span>
    					</p>';
    		}
    
    		return $output;
    	}

    Make sure you keep the function name the same. Because the original function is surrounded by the if condition i mentioned above, the original function will not be called because your new function already exists, so it will be used instead of the original.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.