Forum Replies Created
-
AuthorPosts
-
MarcusMember1221 variables updated and changed.
Because many of them had associated functions to fix little things, I had to do them one by one.Gonna need glasses after that.
Hope I never have to do that again.
Thanks Jason. 🙂
Marcus
MarcusMemberHahah, you’re awesome.
It doesn’t change the fact I still have to change those 1000 places. But at least now I don’t have to write another function. LOL
Thanks Jason.
I’ll shorten it to gspm so I won’t get any hand cramps. LOL
Marcus
MarcusMemberYou may also want to control the days allowable to be clicked by setting the minDate and maxDate such as this:
$("#txtFromDate").datepicker({ minDate: "-15D", maxDate: "+15D" });That will make it so they can only select the 15 days previous or later.
Marcus
MarcusMemberI’ve experienced this one before, I had to use the GET variables for this, as the tabs are kept in the query string.
&flow=edit_demo&flow_page=listsThen to get the flow type you could use:
$flow = filter_input( INPUT_GET, 'flow', FILTER_SANITIZE_STRING );and the tab from:
$tab = filter_input( INPUT_GET, 'flow_page', FILTER_SANITIZE_STRING );That should work.
Marcus
MarcusMemberYeah, Jason. I agree with that.
After all WordPress API even states:$single (boolean) (optional) If set to true then the function will return a single result, as a string. If false, or not set, then the function returns an array of the custom fields. This may not be intuitive in the context of serialized arrays. If you fetch a serialized array with this method you want $single to be true to actually get an unserialized array back. If you pass in false, or leave it out, you will have an array of one, and the value at index 0 will be the serialized string.So I guess my problem is that I have a lot of old data from piklist 0.??? versions mixed with data from the new piklist versions, and the old always returned singles for single select, and the new version, arrays for single selects. 🙂
My problem is I have about 1000 places I need to check and fix this, so I was trying to lazy way of fixing an old problem.
There is a better solution, I just haven’t thought of it yet, or haven’t googled it yet. 🙂
Thanks.
Marcus
MarcusMemberNo problem Tucker. Keep up the good work. 🙂
Hope the project goes well.
Marcus
MarcusMemberYou’re right Tucker.
I should have been a little more observant.Sorry about that. It was just a glaring one so I jumped. 🙂
Here’s the proper usage of get_terms in a piklist select field:
,'choices' => piklist( get_terms('piklist_demo_type', array( 'hide_empty' => false )) ,array( 'term_id' ,'name' ) )Hope that helps bud.
Marcus
MarcusMemberLose return:
piklist( get_terms( 'nav_menu', array( 'hide_empty' => true ) ) );Marcus
MarcusMemberHad the same thing happen to me.
Did a full refresh, cache clear, and finally it started working again. (I think I even cleared some transients)
Try that Jason. If it works, then its a weird caching bug.
Marcus
MarcusMemberHi Cotswold.
From what I can see, (installed opening-hours and checked piklist datepicker fields)
It comes from these lines in Opening Hours init.php file:function op_register_styles_backend() { wp_enqueue_style('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.css', false, false, 'all'); wp_enqueue_style('jQuery-ui-style', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css', false, false, 'all'); wp_enqueue_style('opening-hours-backend', apply_filters( 'op_backend_stylesheet', op_baseurl() . '/css/backend.css' ), false, false, 'all'); wp_register_script('jQuery-ui', 'http://code.jquery.com/ui/1.10.3/jquery-ui.js', false, null, false); wp_register_script('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.js', false, null, false); wp_enqueue_script('jQuery-ui'); wp_enqueue_script('jQuery-ui-timepicker'); }In opening-hours-backend all of the css is changed completely from what piklist has. (due to the same naming conventions)
If you comment out the following:function op_register_styles_backend() { wp_enqueue_style('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.css', false, false, 'all'); // wp_enqueue_style('jQuery-ui-style', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css', false, false, 'all'); // wp_enqueue_style('opening-hours-backend', apply_filters( 'op_backend_stylesheet', op_baseurl() . '/css/backend.css' ), false, false, 'all'); wp_register_script('jQuery-ui', 'http://code.jquery.com/ui/1.10.3/jquery-ui.js', false, null, false); wp_register_script('jQuery-ui-timepicker', op_baseurl() . '/js/jQuery.ui.timepicker/jquery.ui.timepicker.js', false, null, false); wp_enqueue_script('jQuery-ui'); wp_enqueue_script('jQuery-ui-timepicker'); }You should find that piklist datepickers work again, (at least it did for me) but your styles for opening hours will no longer work.
So either you need to hook into a filter that only loads those styles on an opening hours page or plugin, or Piklist will have to change their naming conventions, or opening hours will need to learn how to load native jquery-ui styles and scripts. (as all of those don’t need to be loaded remotely)
There will probably need to be a more elegant solution, but for the 2 minutes I looked at it, this is what I found.
Marcus
MarcusMemberYour welcome Ariev.
I don’t have an install that relies completely on one database, in fact, the staffing would be a different database than the customer one, and the accounting and reporting are different databases, also the users on staffing use a different DB than the users who are parents or children in the customer one.
But with WPMU (WordPress Multisite or Multiuser) all the tables can talk to each other. (so building a new class which is part of the customer db, pulls the data from the staff database, etc.)
And to integrate more databases and data sources, isn’t that difficult.
As you move throughout your development, feel free to post here, and we’ll help in any way we can.
Marcus
MarcusMemberWordpress can definitely handle what your thinking of building.
We use a multisite/multiuser install, that handles a front end site for the customer, a back-end site for the administration, a staffing site for the teachers and rec leaders, and an accounting and ecommerce site for all purchasing and inventory control.
Our client processes over $1.8 million in just 8 weeks, and they handle about 5000 students a year who change classes, staff members, locations, maintenance issues on a weekly, daily, hourly basis, so yes, wordpress can handle what your thinking of doing with it.
You’ve selected a good platform as your client will enjoy the ease of use and familiarity that WordPress provides.
After all, 409 million people a month use wordpress sites. So it can do just about anything, so you’ve selected the right package.And one last note. We use only 1 third party plugin on all of our sites, PIKLIST. 🙂
Everything else is built with my small pea brain and Piklist.Marcus
MarcusMemberpiklist('field' ,array( 'type' => 'group' ,'label' => 'Dates (From - To)' ,'fields' => array( array( 'type' => 'datepicker' ,'field' => 'date_from' ,'label' => 'Date: (from)' ,'options' => array( 'dateFormat' => 'M d, yy' ,'changeYear' => true ) ,'attributes' => array( 'class' => array('date') ,'size' => 12 ) ,'columns' => 6 ,'value' => date('M d, Y') ) ,array( 'type' => 'datepicker' ,'field' => 'date_to' ,'label' => 'Date: (to)' ,'options' => array( 'dateFormat' => 'M d, yy' ,'changeYear' => true ) ,'attributes' => array( 'class' => array('date') ,'size' => 12 ) ,'columns' => 6 ,'value' => date('M d, Y') ) ) ));Would be my best guess of how to do it quickly.
Marcus
MarcusMemberNever mind. Found an easy solution. Your ‘piklist_save_field‘ action works perfectly.
Just added this to my plugin:
add_action( 'piklist_save_field', array($this,'mae_save_refund_checker'), 10, 2 );And this function:
public function mae_save_refund_checker($scope,$fields) { if ($scope=='post_meta' && array_key_exists('mae_merch_pay_status', $fields)) { // Alter Meta data here before its entered. } return $fields; }I added the array_key_exists on the fields to make sure I’m editing the right meta boxes.
(since I know that ‘mae_merch_pay_status’ a metabox field that will never be removed or duplicated, and is only in one place. 🙂 So I can be assured I’m in the right place when editing these post_meta fields.)And voila. I can edit the post_meta just before it goes in.
The post itself, I edit using ‘save_post_{custom_post_type}‘Thanks for making Piklist so easy to work with.
Marcus
MarcusMemberI don’t think its in the user guide. It will eventually I’m sure.
It came from a previous bug, and got the answer, then forgot it.Marcus
-
AuthorPosts