Giter Site home page Giter Site logo

titan-framework's Introduction

alt text Titan Framework

WordPress WordPress plugin Build Status Slack

The easiest to use WordPress options framework.

Titan Framework allows theme and plugin developers to create admin pages, options, meta boxes, and theme customizer options with just a few simple lines of code.

Get it in the WordPress plugin repo

Generate your own Underscores + Titan Framework based WordPress theme

Join the Community in Slack

Features

  • Makes development unbelievably easy
  • Built with optimization in mind
  • Does NOT clutter the database
  • Integrates with your project seamlessly
  • Theme customizer live preview integration
  • Supports child themes
  • Automatic CSS generation with SCSS support

Installing

  1. You can install the latest stable release from the wordpress.org plugin page straight from your WordPress plugin page;

  2. Or you can download the master.zip file then install it as a WordPress plugin;

  3. Alternatively, you can also install it via Composer into your wp-content/plugin folder:

curl -sS https://getcomposer.org/installer | php
php composer.phar create-project gambitph/titan-framework titan-framework

Developing

If you want to help with the development of Titan Framework, we have a Developing guide in the wiki

Creating a WordPress Theme?

Generate your own Underscores + Titan Framework based WordPress theme

Getting Started With Titan Framework

Titan Framework aims to be easily used by everyone. The goal is to make it plug and play - just activate the plugin and start creating your options.

Read our guide on how to get started with Titan Framework

Donate to the Development

If Titan Framework has helped you in any way, we would appreciate any amount of donations that you give us. Donations would mean more development time for the framework as I am continuously developing it during my free time.

Donate

Help Spread the Word on Titan Framework

Titan is super new, so far the framework has been getting good feedback from the community. Help out and spread the word by starring this repo, sending tweets, writing blog posts about what you think about Titan, and review the plugin in the WordPress plugin repo.

Are You Using Titan Framework in Your Project?

Let us know so we can showcase it in the site! Send me a tweet at @bfintal

Contributing, Pull Requests Are Very Welcome

Have an idea for a cool option, or do you have a bug fix you want to implement? Please don't hessitate to place a PR (Pull Request).

PRs on these are welcome:

  • Bug fixes
  • Cool new options
  • Cool new hooks
  • WordPress standardization
  • Code optimizations
  • Anything under the sun as long as it's helpful :)

Translations

We want Titan Framework to be used by everyone, and since not everyone speaks or reads english, we would appreciate it if you can help translate the framework to your language.

Current Translations

  • French (thanks @PunKeel)
  • German (thanks @jascha)
  • Italian (thanks @DavideVogliotti & Giuseppe Pignataro)
  • Portuguese (thanks @pagelab)
  • Spanish (thanks @maperezotero)
  • Turkish (thanks @gurkankara)

Important Links

titan-framework's People

Contributors

ahansson89 avatar amin3d avatar ardalann avatar bfintal avatar dangitrick avatar davidevogliotti avatar desaiuditd avatar dovy avatar faabiosr avatar hsleonis avatar iografica avatar izaacj avatar jaeh avatar julien731 avatar juyal-ahmed avatar kevinlangleyjr avatar limestreet avatar lugat avatar manishsongirkar avatar meathanjay avatar mendezcode avatar mickeykay avatar nemke avatar oherman avatar reggieduran avatar rob006 avatar rockschtar avatar sagarjadhav avatar siamkreative avatar whitesunset avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

titan-framework's Issues

Bug: CSS generated by select-googlefont

This is my customizer option definition:

->createOption( array(
    'name' => 'Header Font',
    'id' => 'header_font',
    'type' => 'select-googlefont',
    'default' => array(
        'name' => 'Exo',
        'variants' => array( '400', 'italic' ),
        'subsets' => array( 'latin-ext' )
    ),
    'css' => 'header { 
        font-family: value-name;
        font-weight: value-variant;
    }'
) );

I saved the customizer without changing this font, and this was added to the CSS:

font-family:Exo;
font-weight:;

Then I changed the font, and the generated CSS became:

font-family:;
font-weight:;

Now even if I change it back to Exo, it still writes empty values to CSS file.

Bug: Server path in font preview iFrames

I just tried out Titan Framework's demo and noticed that in the Google font preview windows, I'm getting this:

<iframe src='http://www.rickbeckman.org/wp-content/plugins/home/[USERNAME_REDACTED]/rickbeckman.org/wp-content/themes/synthesis/admin/titan/iframe-googlefont-preview.php?f=Lobster'></iframe>

Note that I'm including Titan in my theme rather than activating it separately. I saw a commit recently that said embedding was accounted for or similar, but the use of plugins_url() seems to not play nicely with that.

Feature Request: Taxonomy Meta

I have to say this framework is very compelling... great work!
In several of my themes I am using meta fields on categories, using the Tax Meta Class. I'd like to request that Titan framework's meta box functionality be extended to work with taxonomies as well. While WordPress doesn't have native taxonomy meta support, it's certainly possible to do (example 1, example 2), and I would love to have all of my post/taxonomy meta requirements met in one plugin. Thanks for considering!

Feature Request: Allow Options to Be Added to User Profiles

Especially as social integration grows in importance, being able to extend user profiles with new options (such as Google+ profile URLs) would allow a lot more flexibility than just dedicated admin panels would allow. (It would also allow for user-specific settings... Maybe some users want to browse the site with sidebars disabled; a site could have such a setting.)

Possible to get image upload dimensions?

Hi there,

Is there any native Titan method to get/output the dimensions of an image upload option? I'm thinking this would be really handy for the quick CSS generation method that's available, with sizing a logo area based on the logo's size, for example.

Thanks!

Bug: When you try to save updates in the wysiwyg

Fatal error: Uncaught exception 'Exception' with message 'parse error: failed at $newsletter_content: '&lt;p&gt;Lorem ipsum!!&lt;/p&gt; line: 48' in /Users/cuowee/Sites/iustus/wp-content/plugins/titan-framework/inc/scssphp/scss.inc.php:3907 Stack trace: #0 /Users/cuowee/Sites/iustus/wp-content/plugins/titan-framework/inc/scssphp/scss.inc.php(2605): scss_parser->throwParseError() #1 /Users/cuowee/Sites/iustus/wp-content/plugins/titan-framework/inc/scssphp/scss.inc.php(108): scss_parser->parse('$company_name: ...') #2 /Users/cuowee/Sites/iustus/wp-content/plugins/titan-framework/class-titan-css.php(207): scssc->compile('$company_name: ...') #3 [internal function]: TitanFrameworkCSS->generateCSS('') #4 /Users/cuowee/Sites/iustus/wp-includes/plugin.php(429): call_user_func_array(Array, Array) #5 /Users/cuowee/Sites/iustus/wp-content/plugins/titan-framework/class-admin-panel.php(194): do_action('tf_admin_option...') #6 [internal function]: TitanFrameworkAdminPanel->saveOptions('') #7 /Users/cuowee/Sites/iustus/wp-includes/pl in /Users/cuowee/Sites/iustus/wp-content/plugins/titan-framework/inc/scssphp/scss.inc.php on line 3907

Bug: Cannot use the same option name in two different instances

I just copied my plugin and created another plugin. I changed all the variable names and everything, except for the option IDs. I'm getting this error now:

Titan Framework Error: All option IDs must be unique. The id activated has been used multiple times. 

Now we can say two instances of TF cannot have the same option IDs, which means it's not a bug. In this case, it must be clearly mentioned in the documentation.
However, one of the biggest benefits of doing this OO is that our instances can be completely separate. So option IDs in one instance shouldn't be checked with option IDs from another instance. I think this is how it's supposed to work. What do you think?

Font Picker Bug

Not sure if I've done something incorrectly, but I'm getting the following warnings and error when trying to reset to defaults with the new font picker option:

Warning: stripslashes() expects parameter 1 to be string, array given in /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/class-option-font.php on line 758

Warning: stripslashes() expects parameter 1 to be string, array given in /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/class-option-font.php on line 758

Warning: Invalid argument supplied for foreach() in /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/class-option-font.php on line 183

Warning: Invalid argument supplied for foreach() in /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/class-option-font.php on line 183

Fatal error: Uncaught exception 'Exception' with message 'parse error: failed at `$body_font` line: 12' in /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/inc/scssphp/scss.inc.php:3907 Stack trace: #0 /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/inc/scssphp/scss.inc.php(2605): scss_parser->throwParseError() #1 /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/inc/scssphp/scss.inc.php(108): scss_parser->parse('$layout: full-w...') #2 /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/class-titan-css.php(257): scssc->compile('$layout: full-w...') #3 /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/class-titan-css.php(271): TitanFrameworkCSS->generateCSS() #4 [internal function]: TitanFrameworkCSS->generateSaveCSS('') #5 /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-includes/plugin.php(429): call_user_func_array(Array, Array) #6 / in /Users/Mickey/Sites/WP Plugins - Test/trunk/wp-content/themes/bbbb/core/titan-framework/inc/scssphp/scss.inc.php on line 3907

The code for these options looks like this:

// Heading font
$tab2->createOption( array(
    'name' => __( 'Heading Font', 'bbbb' ),
    'id' => 'heading_font',
    'type' => 'font',
    'show_font_weight' => false,
    'show_font_style' => false,
    'show_line_height' => false,
    'show_letter_spacing' => false,
    'show_text_transform' => false,
    'show_font_variant' => false,
    'show_text_shadow' => false,
    'default' => array(
        'font-family' => 'PT Sans',
        'color' => '#333333',
        'font-size' => '16px',
    )
) );

// Body font
$tab2->createOption( array(
    'name' => __( 'Body Font', 'bbbb' ),
    'id' => 'body_font',
    'type' => 'font',
    'show_font_weight' => false,
    'show_font_style' => false,
    'show_line_height' => false,
    'show_letter_spacing' => false,
    'show_text_transform' => false,
    'show_font_variant' => false,
    'show_text_shadow' => false,
    'default' => array(
        'font-family' => 'PT Sans',
        'color' => '#333333',
        'font-size' => '16px',
    )
) );

And the function generating the CSS looks like this:

$titan->createCSS( "
    body {
        body_font
    }

    h1, h2, h3, h4, h5, h6 {
        heading_font
    }
" );

Not sure if this is the right format for outputting the new font options all together, but I've also tried the following and gotten the same issue:

$titan->createCSS( "
    body {
        \$body_font
    }

    h1, h2, h3, h4, h5, h6 {
        \$heading_font
    }
" );

And:

$titan->createCSS( "
    body {
        font-family: \$body_font-name;
    }

    h1, h2, h3, h4, h5, h6 {
        font-family: \$heading_font-name;
    }
" );

So I can't seem to reset defaults, and I can't get the CSS to output. Any ideas?

Bug: Only one TF-generated CSS file is enqueued when there are 2+ instances of TF

My theme was working based on TF just fine. When I created a plugin with an admin panel (the admin panel has only one 'test' text field), an empty CSS file got enqueued to all pages (which is for the plugin) and the theme settings CSS file (generated by TF) is not enqueued anymore.
I think the 'enqueueCSS()' function in class-titan-css.php has to be changed, but I'm not sure.

getOption wont work

Ive tried sevral times in meny places (page.php, single.php, header.php) but I just cant seem to get it to work heres the code ive used:
This is in the: page.php

getOption( 'my_text_option' ); ?>

This is in the: functions.php
$titan = TitanFramework::getInstance( 'my-theme' );
/** Creating an admin page tab **/
$panel = $titan->createAdminPanel( array('name' => 'Thorbis Admin Panel',) );

/TABS/
$myTab = $panel->createTab( array('name' => 'General',) );

                $myTab->createOption( array(
                    'name' => 'My Text Option',
                    'id' => 'my_text_option',
                    'type' => 'text',
                    'desc' => 'This is our option'
                ) );

                $myTab->createOption( array(
                    'name' => 'My Select Option',
                    'id' => 'my_select_option',
                    'type' => 'select',
                    'options' => array(
                        '1' => 'Option one',
                        '2' => 'Option two',
                        '3' => 'Option three',
                    ),
                    'desc' => 'This is a select drop down box',
                    'default' => '2',
                ) );

                $myTab->createOption( array(
                    'type' => 'save'
                ) );

I type "HI" in the 'my_select_option' field and nothing will show up on the other end.

Gallery Field

I wonder why is so hard to find a framework that include it by default.
I have a lot of clients who I needed to add a Gallery custom post type to make it easy for them to add new albums, and I need a separate field just for the main gallery itself, because ask them to use 'add media -> create gallery' and also add the description together on the editor, confuses 99% of them :)

It also can be useful if we want a scrolling gallery section on any place like the homepage for example :)

May you guys consider this? Thanks :)

how to change default icon of custom plugin?

Is there a way to make the icon personal? or can it be a new add-on to the framework?
example image.... woocommerce has a "woo" logo next to there plugin, same with SEO also, and mine is a gear.

thorbis admin panel thorbis website design wordpress

Feature Request: New Option Types: Sortables

Scenario: A theme developer wants to give users the option of changing how posts' bylines are shown, right down to customizing the order of meta info such as author, post date, update date, # of comments, and so on, or whether any of those elements should be hidden.

It would be awesome if Titan included an option type which would facilitate this behavior. Users implementing options in Titan would have to specify that a sortable type is needed, along with an array of sortable objects (IDs, names, optional descriptions, visibility).

The GUI for this option would be a drag-and-droppable list which shows the name/description of each sortable object, along with a checkbox on each to save the visibility setting.

And when pulling that option from the database, theme/plugin devs would be given an array of all the relevant info, sorted according to the proper display order as chosen in the admin panel.

Translation

Hi,
I think it could be cool if this project were on Transifex, so we can help to translate it :)

Thanks in advance

How to pass the array into createOption?

This isn't working, please correct me.

$umoTab->createOption( array(
'name' => 'Layout',
'id' => 'um_layout_opt',
'type' => 'select',
'desc' => 'Avaliable layout css',
'option' => get_layout_option()
) );

get_layout_option() function return array.

Bug: Some hooks must NOT have the same name for all instances

I just started creating a plugin that uses TF for generating admin panels, while using TF for generating customizer options for the theme.
As soon as I generated an instance for the plugin:

TitanFramework::getInstance( 'abc' )

I received an error for each customizer option that I had:

Titan Framework Error: All option IDs must be unique. The id ... has been used multiple times. 

I looked into the code and found the problem. It's exactly what I talked about on #46 this morning.

Whenever an instance of TF is generated, line 59 of class-titan-framework.php is called:

    add_action( 'tf_create_option', array( $this, "verifyUniqueIDs" ) );

Let's assume N plugins have created an instance of TF. When the (N+1)th plugin (or theme) generates an instance of TF, whenever it creates an option in
an admin panel (class-admin-panel.php line 366),
admin tab (class-admin-tab.php line 45),
metabox (class-meta-box.php line 183)
or customizer section (class-theme-customizer-section.php line 133),

        do_action( 'tf_create_option', $obj );

It runs verifyUniqueIDs function N times, with the same $obj. So the first time is okay, but the next (N-1) times it will print an error.

I wanted to fix this myself, but I didn't do it for 2 reasons:

  1. I think @bfintal is much more familiar with the code, and he should look for hooks that could potentially cause the same issue, and add sth like "-instancename" at the end of hook name. In fact, I think unless our purpose is to create a hook for ALL instances, hook name should include the instance name.
  2. I can edit files using github website, but I have some issues with github software, It gives me an error whenever I try to sync data with server.

Feature Request: Allow Options to Extend Default WordPress Panels

WordPress allows settings to be added to at least some (if not all) of its default admin panels (ex: http://trepmal.com/2011/03/07/add-field-to-general-settings-page/).

While it does make sense for plugins/themes with lots of options to have their own admin panel, it would be awesome if options could be added to the default admin panels.

Advantages of this:

  • Plugins better blend into WordPress, creating a more native environment.
  • Some plugins don't have many options; creating an entirely new admin page for them seems unnecessary.
  • Some options are so related to existing WordPress options, they should be grouped with those WP options for consistency. (ex: a theme option that controls display of Gravatars could be displayed in the Discussion panel).

getOption Errors in Theme File

I am using the Titan framework to get a logo in header.php and I receive the error "Titan Framework Error: Wrong usage of getOption, this should be called inside a hook or from within a theme file."

Bug Report: Cannot generate CSS for Upload option type

I'm using the latest class-titan-css.php ( https://github.com/gambitph/Titan-Framework/blob/ee13451f14470ac2e28884687784979b3f14b98a/class-titan-css.php )

createOption( array(
    'name' => 'Background Image',
    'id' => 'background_image',
    'type' => 'upload',
    'default' => '',
    'livepreview' => '$("body>.background-image").css("background-image", "url(\'"+value+"\')");',
    'css' => 'body>.background-image { background-image: url(\'value\'); }'
) );

The generated CSS is:

body > .background-image{background-image:url('$background_image');}

If I change the css attribute to

    'css' => 'body>.background-image { background-image: url(value); }'

The generated CSS becomes:

body > .background-image{background-image:url();}
  • there IS an uploaded file

Feature Request: Raw Option Returning

I notice that when calling Google font options, Titan automatically enqueues the font for the user.

While that is useful, no doubt, it would be nice to be able to return the option "raw," without any extra processing on the part of Titan (no enqueuing), so that the data can be handled by the theme or plugin directly.

WordPress Coding Standards

This is a "biggie" if only 'cause it'll effect many lines of code, but have you given any thought to using the WP coding guidelines?

It'd make for a more consistent code environment for anyone using Titan within their plugins or themes, would reduce the file sizes a bit (1 tab vs. a few spaces, times a lot), and so on. Not a huge deal by any means.

And if you want to do this, I could do a lot of it in a pull request.

Feature Request: HTML5 readiness

With the advent of HTML5, forms have become much more flexible (http://diveintohtml5.info/forms.html is my favorite reference of such).

New form fields -- email, color, url, number, range, date, search, etc -- coupled with new features such as validation make forms incredibly versatile.

Implementing these new features will allow themes/plugins to have forms with fields which are extremely specific for what they may contain and which have browser-powered validation to ensure only the correct sort of data is being input.

frontend load

Is it possible to run Titan with zero frontend load?

Is there a way to get radio Image options to display in two rows?

I'm including a lot of background image options in my theme and am implementing the radio-image selection tool to show them. However, even when I trimmed them down in width, they are still pushing the content way off the page to the right in the theme options panel.

Thanks!

Support for the letters åäö in name

When creating a Admin Panel it generates an error.

"You do not have sufficient permissions to access this page."

// Option Panel
$optionsPanel = $titan->createAdminPanel(array(
'name' => 'Företagsinställningar'
));

Same goes for

$settings = $optionsPanel->createTab(array(
'name' => 'Inställningar'
));

$settings->createOption(array(
'name' => 'Svenska bokstäver åäö',
'id' => 'letters',
'type' => 'text'
));

$settings->createOption(array(
'type' => 'save'
));

When i try to save it shows the success msg but hides the input fields the data is save though.

Feature Request: Repeatable Options

Description:
First, take a look at this screenshot: http://grab.by/uRbO
These are settings inside a metabox that I created for a simple slider on top of each page.

It's all just one option that could be named 'repeatable'. And inside this option, we have defined 2 other options (a GROUP of options): Slide Type and File (in this case, if you choose 'video' slide type it automatically replaces that Choose Image button with a text field for video URL, which could be made using this requested feature: #20 sub-options)

And what does this 'repeatable' option type do? It lets you add multiple instances of this group of options, sort them, and remove them. In fact, 'repeatable' has some features from containers, and some features from option types.

Some Sample Uses:

  • Adding social media icons to the theme
  • Adding images or attached documents to a post type
  • Adding custom attributes to a post type
  • Adding staff list with pictures to a custom post type
  • It could also be used for the scenario mentioned in #10 Sortables , so we don't need that option anymore. it could be covered by 'repeatable'
  • And much more...

This option adds much more flexibility, and could be a game changer for the framework. One screenshot of this option (and the code that's generated it) in Titan's homepage could grab everyone's attention and make them believe that this framework is superior to any other framework in the market.

WYSIWYG

Really nice plugin you got going here. Liking it alot. Been using ACF for about six months now. But this plugin is more lightweight and prob a timesaver for our company.

There is one slight problem, there is now wysiwyg type. Which i use 2 - 5times per wordpress theme. Shouldnt be to hard to integrate though.

Possible Bug: Adding many 'font' options delays preview refresh

I don't know if it's a bug within TF or not, but it's really annoying.

I added 7 'font' options (6 of which are for h1 to h6). I also have 8 other 'font' options in other sections.

I noticed before, that when I add a 'font' option, it adds a delay for reloading the preview after editing an option that doesn't have 'livepreview'. (not necessarily a font option)
It's not because of low internet speed or server speed. The request to the server is made AFTER this delay. After I change an option, I also click on another option to trigger 'blur' and 'change' js events.

Now that I added 7 'font' options all at once, I'm noticing a huge delay before reloading the preview iframe.
With 8 'font' options it has about 8sec delay, and with 15 it has about 17sec delay.

Any idea what's causing this? Anyone else having the same issue?

Feature Request: Sub-options

Not every option is relevant in every situation. Some may only be needed if another option is set to true.

I'm not sure how possible this would be, but it would add a good deal of flexibility if certain options can be set to "hidden" until their "parent" option is toggled, making them relevant.

This can be used for any number of things, but this is an example I see often enough:

Assume a theme has options to choose the widths of its columns, as well as the widths of the number of columns.

If a 1-column layout is chosen, only one width field is needed (the main one).

If a 2-column layout is chosen, two width fields are needed, along with an image-type radio option for choosing the layout (sidebar|content or content|sidebar).

If a 3-column layout is chosen, three width fields are needed, along with a different image-type radio option for the layout choice (sidebar|sidebar|content, sidebar|content|sidebar, and content|sidebar|sidebar).

Add Optional Parameter to Change Font Sample Text

Is there any way to edit the example text in the new font option? The full lorem paragraph text takes up a ton of space, and it would be nice to have the option to edit the sample text that displays.

Generated CSS has error

Hi there,

When I use either one of Titan's two CSS generating methods for a color option, the CSS being created has quotes around the actual value, and the CSS therefore doesn't work. For example, I'm using the following code:

$tab1->createOption( array(
    'name' => __( 'Header Background Color', 'bbbb' ),
    'id' => 'header_background_color',
    'type' => 'color',
    'default' => '#336699',
) );

$titan->createCSS( "
    .site-header {
        background-color: \$header_background_color;
    }
" );

and this is what is being output in the generated CSS file:

.site-header .wrap{background-color:'#336699';}

You can see the single quotes around the color hex value, which invalidates the CSS.

Suggestion for the documentation: Hooks and Filters

In my settings, there's a checkbox that registers a new post type when it's checked. This custom post type was supposed to have a rewritten URL, but it didn't work. Until I found this in WordPress Codex ( http://codex.wordpress.org/Function_Reference/register_post_type ):

Note: If registering a post type inside of a plugin, call flush_rewrite_rules() in your 
activation and deactivation hook (see Flushing Rewrite on Activation below). 
If flush_rewrite_rules() is not used, then you will have to manually go to 
Settings > Permalinks and refresh your permalink structure before your custom 
post type will show the correct structure. 

So I looked for a hook that is called right after saving data, and I found 'tf_admin_options_saved_{namespace}'
I added this line of code:

add_action('tf_admin_options_saved_mythemename', 'flush_rewrite_rules');

Aaaand it's fixed!
The hook was really helpful. I was thinking, maybe other developers face the same issue, and having this somewhere inside the documentation could help them out. Maybe we should have a documentation section for hooks and filters.

Request: metaboxes on more than one post type

Unless I'm missing something, there's no easy way to attach a metabox to more than one post type without running a for loop and assigning a unique metabox to each post type (with a unique id no less). It would be great if the createMetaBox() functionality could work like this:

$metabox = $titan->createMetaBox( array(
    'name' => 'Name',
    'post_type' => array( 'post', 'page', 'custom-post-type' ),
) );

Font picker show_font_size issues

Two issues.

  1. Setting this to false doesn't seem to have any effect - the font-size selector shows up regardless.
  2. The label for the font-size picker is not properly aligned vertically. Not sure if this is just a WP issue or something to do with Titan.
    image

Thanks!

Better Image Option

Part 1: return attachment ID instead of the URL of the image #62
Part 2: redesign image option to look similar to #45, suggestions also in #62

Feature Request: New Option Types: Font Picker

Every theme needs multiple font settings for menu, submenu, headings, footer, paragraphs, etc.
These font settings are: font-family, font-size, font-style(Italic/Normal), font-weight, color
I tried to add these fields to customizer, and look how these settings for EACH element look like: http://grab.by/uyA4
It's not user-friendly at all, and it's taking way too much space.
A complete font-picker would be a brilliant solution, using which you can create all these fields at once and the returned value is ready to be used in front of "font:" css attribute; except color. so the returned value could be sth like:
array('italic bold 12px Georgia,serif', '#123123')

Font family picker could be just the way it is right now, but color picker, size picker, bold and italic options can be in the same line. You can also use jQuery UI Spinner for picking font size. (it could be used for the option type "number" in general) http://jqueryui.com/spinner/

Feature Request: Ability to remove options and containers added before

I'm creating a theme using Titan Framework, and I'm adding some core options (customizer options, metaboxes, admin tabs and panels).

For each website that I'm creating using this theme, I'm going to create a child theme, that must be able to remove some of those core options. But Titan doesn't have the ability to remove options that are already created.

I think adding this feature is really necessary for the framework.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.