Skip to content

Instantly share code, notes, and snippets.

@daronspence
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daronspence/d86049809d03c4906a94 to your computer and use it in GitHub Desktop.
Save daronspence/d86049809d03c4906a94 to your computer and use it in GitHub Desktop.
How to include widgets through a plugin or theme files.
add_filter( 'acfw_include_widgets', 'add_include_widgets' );
function add_include_widgets(){
$acfw_widgets = array(
array(
'title' => 'Test Widget 1',
'description' => 'A widget test from functions.php',
'slug' => 'test-widget',
'id' => 'Test_Widget',
),
array(
'title' => 'Test Widget 2',
'description' => 'A second widget test from functions.php',
'slug' => 'test-widget-2',
'id' => 'Test_Widget2',
),
);
return $acfw_widgets;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment