Carbon Fields extension, that adds a SmartLink field type.
This field allows you to select between internal and external links, choosing from a dropdown of Posts and Archives for internal links or manually entering a URL for external.
This repository is based on htmlburger/carbon-fields-template.
composer require evanshunt/carbon-fields-smartlink
use Carbon_Fields\Field\Field; ... Field::make('smartlink', 'your_field_name', 'Your Field Name');
- Build in logic to neatly upgrade from a text URL field, redefining such as an external link.
- Add support for taxonomies, etc.
webpack.config.jsand make sure
const rootpoints to the directory where Carbon Fields are installed (e.g.
const root = path.resolve(__dirname, '../vendor/includes/htmlburger/carbon-fields');)
npm installin the root directory to install all build process requirements.
npm run buildto build the final minimized assets
npm run dev to continuously build assets during development. Note that you should add
define( 'SCRIPT_DEBUG', true ); to your
wp-config.php file in order to load the files generated by the dev build process.