carbon-fields icon indicating copy to clipboard operation
carbon-fields copied to clipboard

Carbon Fields in MU Plugins

Open duncanarrow opened this issue 3 years ago • 4 comments

I take it Carbon Fields can't be installed via the mu-plugins folder?

I just like the idea of it being out of view of clients, but it doesn't work when I put it in there. Unless I'm missing something?

duncanarrow avatar Jul 08 '21 11:07 duncanarrow

If you want to get it out of the clients grasp you can create a vendor folder in a child theme and include it using that. These should help you to do so: https://developer.wordpress.org/themes/advanced-topics/child-themes/ https://docs.carbonfields.net/quickstart.html

Put the code in the functions.php of the child theme.

dhalucario avatar Dec 16 '21 13:12 dhalucario

Thanks. I'm just having problems using Composer on my local MAMP install. I can compile it but when I drag the directory online it crashes the website claiming the files can't be found.

I've never found Composer particularly user-friendly. I'm sure I'm doing something wrong but I have no idea what.

Hence why I always revert back to the pre-compiled plug in version.

duncanarrow avatar Dec 16 '21 17:12 duncanarrow

Would you mind showing us the error you get when you upload the files and show us where you uploaded the files using screenshots?

dhalucario avatar Dec 16 '21 21:12 dhalucario

I added the fields plugin directory carbon-fields to mu-plugins

And I connected this plugin using a file: mu-plugins/carbon-fields.php

I copied the name and description of the plugin there and connected the main file carbon-fields-plugin.php from the plugin directory

<?php
/**
 * Plugin Name: Carbon Fields
 * Description: WordPress developer-friendly custom fields for post types, taxonomy terms, users, comments, widgets, options, navigation menus and more.
 * Version: 3.6.3
 * Author: htmlburger
 * Author URI: https://htmlburger.com/
 * Plugin URI: http://carbonfields.net/
 * License: GPL2
 * Requires at least: 5.0
 * Tested up to: 6.4
 * Text Domain: carbon-fields
 * Domain Path: /languages
 */

require_once plugin_dir_path( __FILE__ ) . 'carbon-fields/carbon-fields-plugin.php';

It turned out that all the functionality works as standard!

xrazrab avatar May 12 '24 15:05 xrazrab