Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Title field type handles extra args #656

Closed
wants to merge 4 commits into from

Conversation

vladolaru
Copy link

Currently, the Title type didn't take into consideration extra arguments like 'attributes'. Now it does, just like the rest of the fields. This will allow for add-ons like CMB2-conditionals to work for this field type also.

Vlad Olaru added 2 commits June 2, 2016 09:38
Currently, the Title type didn't take into consideration extra arguments like 'attributes'. Now it does.
@jtsternberg
Copy link
Member

Nice catch. Remove the $args passed into the method, and I'll merge it in. It's not needed, because the $args are passed to it from the CMB2_Types object.


return $this->rendered(
sprintf( '<%1$s class="%2$s">%3$s</%1$s>%4$s', $a['tag'], $a['class'], $a['name'], $a['desc'] )
sprintf( '<%1$s %2$s/>%3$s</%1$s>%4$s', $a['tag'], $this->concat_attrs( $a, array( 'tag', 'name', 'desc' ) ), $a['name'], $a['desc'] )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there an extra forward slash before %3$s?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I am not careful :)

@vladolaru
Copy link
Author

I have removed the $args and the slash. Keep up the good work.

@jtsternberg
Copy link
Member

Thanks. Still a no-go. You don't need to pass the $this->args args as they are assumed: https://github.com/WebDevStudios/CMB2/blob/trunk/includes/types/CMB2_Type_Base.php#L86

@vladolaru
Copy link
Author

Damn. Ok. Removed it for good now.

jtsternberg added a commit that referenced this pull request Jun 3, 2016
…ixelgrade/trunk.

Squashed commit of the following:

commit d3dad17ad8a97c50134dcb865b47cf4920458239
Author: Justin Sternberg <justin@dsgnwrks.pro>
Date:   Fri Jun 3 13:52:49 2016 -0400

    Clean up

commit 8b94b02
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Fri Jun 3 10:30:49 2016 +0300

    Removed the $args for good

commit 09e83ff
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Thu Jun 2 21:29:31 2016 +0300

    Removed the $args and bad slash for the title field

commit c6c2b1f
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Thu Jun 2 09:52:13 2016 +0300

    Added PHPDoc for the title type render function

commit 1e6369d
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Thu Jun 2 09:38:14 2016 +0300

    Make the Title type handle extra args

    Currently, the Title type didn't take into consideration extra arguments like 'attributes'. Now it does.
jtsternberg added a commit that referenced this pull request Jun 3, 2016
…ixelgrade/trunk.

Squashed commit of the following:

commit d3dad17ad8a97c50134dcb865b47cf4920458239
Author: Justin Sternberg <justin@dsgnwrks.pro>
Date:   Fri Jun 3 13:52:49 2016 -0400

    Clean up

commit 8b94b02
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Fri Jun 3 10:30:49 2016 +0300

    Removed the $args for good

commit 09e83ff
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Thu Jun 2 21:29:31 2016 +0300

    Removed the $args and bad slash for the title field

commit c6c2b1f
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Thu Jun 2 09:52:13 2016 +0300

    Added PHPDoc for the title type render function

commit 1e6369d
Author: Vlad Olaru <vlad.olaru@pixelgrade.com>
Date:   Thu Jun 2 09:38:14 2016 +0300

    Make the Title type handle extra args

    Currently, the Title type didn't take into consideration extra arguments like 'attributes'. Now it does.
@jtsternberg
Copy link
Member

A bit of cleanup and this is merged: c171812

Thank you!

@jtsternberg jtsternberg closed this Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants