Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Justin Sternberg
@jtsternberg
@jcchavezs nice! congrats :)
@ashawkat cmb2 taxonomy fields are meant to replace WP built-in taxonomy metaboxes. If you're looking for different functionality, you'll have to build it. I suggest you look here: https://github.com/WebDevStudios/CMB2/wiki/Tips-&-Tricks#a-dropdown-for-taxonomy-terms-which-does-not-set-the-term-on-the-post
Scott Kingsley Clark
@sc0ttkclark
do people normally hang here and talk dev?
Justin Sternberg
@jtsternberg
@sc0ttkclark well, I don't think normally is the right word. :)
Scott Kingsley Clark
@sc0ttkclark
i may just hit you up in slack LOL
don't need to chat now, was just curious
catch you later
Justin Sternberg
@jtsternberg
@sc0ttkclark, ok, you know where to find me. :)
Juan Rangel
@JuanRangel
Hey @jtsternberg, is it currently possible to change the order of the way the repeating fields are added? Instead of the latest entry added to the bottom, have it add to the top?
Justin Sternberg
@jtsternberg
@JuanRangel hmmm no, not really without hacking things. I guess you could overload the cmb.addAjaxRow method if you are JS savvy
Leon Francis Shelhamer
@twoelevenjay
@JuanRangel if you open cmb2/js/cmb2.js and edit line 499, changing $table.find('.cmb-repeatable-grouping').last(); to '$table.find('.cmb-repeatable-grouping').first();' and edit line 508. changing $oldRow.after( $newRow ); into $oldRow.before( $newRow ); it will do what you want. However you would probably want more to make sure the page scrolls to the new row. Also this will not affect how the rows load from the server.
Justin Sternberg
@jtsternberg
Please don't edit core. That's a very bad idea. There is no guarantee that your copy of the library is what will be loaded.
Leon Francis Shelhamer
@twoelevenjay
yeah that was the non minified .js file that only loads when SCRIPT_DEBUG is enabled. Sorry just tried to give a starting point.
Justin Sternberg
@jtsternberg
Understood
Leon Francis Shelhamer
@twoelevenjay
I just uploaded my initial release of "CMB2 Admin Extension" to GitHub: https://github.com/twoelevenjay/CMB2-Admin-Extension. I submitted it to wordpress.org. It is my first plugin submission there ever. It is kinda bare bones but I hope to add many useful features in the near future. Would love any feedback good or bad.
Congrats @jcchavezs, I will definitely be adding features to my plugin that use yours.
Justin Sternberg
@jtsternberg
Nice! I'll try & check it out!
José Carlos Chávez
@jcchavezs
Great @twoelevenjay. Let me know if i can help you in any way. Congrats for the plugin BTW!
Leon Francis Shelhamer
@twoelevenjay
@jcchavezs , @jtsternberg , is there a way to use the same git repository on my local machine as my SVN repository for the plugin on WordPress.org? Sorry I know this is off topic.
Justin Sternberg
@jtsternberg
Yes. :)
Checkout the svn repo, then move the .git folder into it.
It's a little more complicated then that, but is what I do.
Leon Francis Shelhamer
@twoelevenjay
thank you, I use git tower and it had a way to add an SVN repo, so I am trying that. lol
looks like it may take a year to fetch though lol
Leon Francis Shelhamer
@twoelevenjay
@jcchavezs , @jtsternberg , here is my plugin on .org. https://wordpress.org/plugins/cmb2-admin-extension/ I added a banner but it seems like when I psuh changes with SVN the images don't upload. Is there a specific way to push the assets directory?
Justin Sternberg
@jtsternberg
Nice! It should all be here: https://wordpress.org/plugins/about/faq/
Leon Francis Shelhamer
@twoelevenjay
Yeah I read that and after reading:"After you check in your new banner(s), it will appear the next time the plugin refreshes itself in the directory. This may take a few minutes."
Justin Sternberg
@jtsternberg
Leon Francis Shelhamer
@twoelevenjay
I ran an svn ci command and it showed my readme.txt upload from trunk but nothing from assets.
Yeah on my local machine I have an assets directory in the same root as the trunk directory and that is where I places the images.
Leon Francis Shelhamer
@twoelevenjay
It feels like it only checks in the trunk directory. No worries, I will do some more searches later, I was stumped but not a critical issue. THANK YOU for all the help!
Justin Sternberg
@jtsternberg
The assets directory cannot be INSIDE trunk. It needs to be adjacent to it.
Oh, maybe that's what you're saying you did
cggit
@cggit
Is there a CMB way to hide default fields like Wysiwyg or you have to use remove_post_type_support()?
Justin Sternberg
@jtsternberg
No, CMB2 does not handle hiding default fields.
cggit
@cggit
thx
cggit
@cggit
I'd like to use a group_fields field title as a group_title in a repeatable group. aka replace Entry {#} with a field title if its set. So the relevant fields in an array but cant figure out how to iterate with without the {#}
So = I have
get_post_meta( $cmb_group->object_id, $prefix . 'demo' )[0][0]['title'];
cggit
@cggit
i need to increment the second [0] to get the appropriate titles..
Is there a better way to do this?
cggit
@cggit
i guess i could write JS that does this instead but would like to know if theres a simple way to do it with PHP
cggit
@cggit
thought id be able to use (int) '{#}' to iterate over the array but it doesnt work
Justin Sternberg
@jtsternberg
No matter how you do it, you'll still need to implement some JS to handle the change when you add fields
cggit
@cggit
i'm ok with new fields being Entry # since it wouldn't have a title field yet
Juan Rangel
@JuanRangel
Anybody pretty familiar with the javascript for adding repeating fields? I need some help.
Justin Sternberg
@jtsternberg
What kind of help?
Juan Rangel
@JuanRangel
I am trying to conditionally show a setup of fields depending on the value of the select box. So I created a select field with my options and using JS I hide all other fields in that metabox. I then use a switch case block to show the necessary fields. This is inside of a repeating field.
The issue I am having is this; I show the fields using .on('change') so when the page loads all fields are hidden until the select box is changed. Also when I add a new repeater block the .on(change) has no effect.
James DiGioia
@mAAdhaTTah
got a full code example? you might need to add event bindings to the newly added repeater block