Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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
Juan Rangel
@JuanRangel
I'd really appreciate if anyone can help me out. I can send some $$ via paypal.
Justin Sternberg
@jtsternberg
.on events won't work if you're attaching them to selectors which get injected to the Dom. E.g. $('.selector-which-gets-added').on( 'event' won't work, but $('body').on( 'event', '.selector-which-gets-added' should.
James DiGioia
@mAAdhaTTah
also you dont need to keep passing your variables into the jquery selector, they're already jquery objects
lines 4,5 & 6 can just be module.find
cggit
@cggit
is there a built in way to get group styles without repeater support? I want all my cmb2 cpt fields to look like they're in one metabox.
cggit
@cggit
my bad I got it
Justin Sternberg
@jtsternberg
Was just about to respond. Nice.
cggit
@cggit
ha thanks anyways.
Juan Rangel
@JuanRangel
Hey Fellas, I am still having the same issues on customizing the conditional logic. If someone wouldn't mind helping me out via skype or something I can send some $$ via paypal. Im asking here because we are all familiar with CMB2.