nymets1104
Forum Replies Created
-
I use this exact setup on my site to create the post title.
reference here: https://docs.pods.io/code/filter-reference/pods_api_pre_save_pod_item_podname/
I needed my pods field incident_number to be the post title and slug for the post.
add_filter( 'pods_api_pre_save_pod_item_incident', 'slug_set_title', 10, 2); function slug_set_title($pieces, $is_new_item) { //only for a new post if(!$is_new_item){ return; } //make sure that all 2 fields are active $fields = array( 'post_title', 'incident_number', 'pictometry_url'); foreach( $fields as $field ) { if ( ! in_array( $field, $pieces[ 'fields_active'] ) ) { $pieces['fields_active'][] = $field; } } //set post title using pod field script $pieces[ 'object_fields' ][ 'post_title' ][ 'value' ] = $pieces[ 'fields' ][ 'incident_number' ][ 'value' ]; //return $pieces to save return $pieces; }OK Thank you for reply. Can we add an option to disable the popups for new comments…etc?
Forum: Plugins
In reply to: [Code Snippets] Basic Snippets not runningShea, sorry for the delay in getting back to you. I got this all sorted out and I found that it had nothing to do with your plugin. I ended up migrating my site to a host with a much more robust support of PHP. I am currently running several valid PHP snippets with your plugin.
Thanks for your work and response!
David McCaran
Forum: Plugins
In reply to: [Code Snippets] Basic Snippets not runningI tried your code and still get nothing. I checked the source of my page and this meta tag is not on any webpage. I am running PHP 5.3 on a Fatcow Shared Hosting platform. I was able to get a Code Snippet to work on the back end:
// replace WordPress Howdy in WordPress 3.3 function replace_howdy( $wp_admin_bar ) { $my_account=$wp_admin_bar->get_node('my-account'); $newtitle = str_replace( 'Howdy,', 'Welcome to OYC,', $my_account->title ); $wp_admin_bar->add_node( array( 'id' => 'my-account', 'title' => $newtitle, ) ); } add_filter( 'admin_bar_menu', 'replace_howdy',25 );as well as this snippet that allows shortcodes in widgets:
add_filter('widget_text', 'do_shortcode');Are there certain codes that are not supported or should it be all valid PHP scripts?
Forum: Fixing WordPress
In reply to: Multiple 500 Internal Server Errors, but site is working fine?Marked as Resolved
Forum: Fixing WordPress
In reply to: Multiple 500 Internal Server Errors, but site is working fine?I cant be certain, but it seems this was related to a jetpack update?
I updated the jetpack plugin, but the “connection” to my site was lost. I had to re-connect jetpack and then the 500 errors went away? I will keep an eye on this but for now I am getting no more Server Errors in the log related to themes or plugins.
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?OK, I believe I fixed the 500 Errors (I think they were jetpack related). I am now trying to run this snippet with the javascript option rather than the html extraction:
if (!function_exists('wfu_before_file_upload_handler')) { function wfu_before_file_upload_handler($file_path, $file_unique_id) { $_SESSION['wfu_tempfiles'][$file_unique_id] = $file_path; return $file_path; $message="TEST MESSAGE nymets1104"; wfu_debug_log($message); } add_filter('wfu_before_file_upload', 'wfu_before_file_upload_handler', 10, 2); } if (!function_exists('wfu_after_file_upload_handler')) { function wfu_after_file_upload_handler($changable_data, $additional_data) { if ($additional_data['upload_result'] == 'success' && isset($_SESSION['wfu_tempfiles'][$file_unique_id]) && $_SESSION['wfu_tempfiles'][$file_unique_id] != '') { $file_contents = file_get_contents($_SESSION['wfu_tempfiles'][$file_unique_id]); // perform here html extraction // header("Refresh:0"); // you can set javascript code to run in client browser using $changable_data['js_script']="document.write(5 + 6);" $changable_data['js_script']='alert("I am an alert box!");' } return $changable_data; } add_filter('wfu_after_file_upload', 'wfu_after_file_upload_handler', 10, 2); }As before, I am succesfully uploading the file, but nothing happens after that on the front end. Perhaps I am calling the script at the wrong time in the snippet??
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?Not yet,
I essentially only need to extract the file name or the path to the file. Would this information be stored in the $file_contents?
Would this require a refresh of the page as well I am thinking in order to display the uploaded image/video on the page?
Forum: Fixing WordPress
In reply to: Website not loadingAre you able to access your site via ftp or your hosts cpanel? If so, just rename the bp plugin folder temporarily and reload your site.
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?I checked another page that has a different plugin on it and I am getting a similar 500 error so I dont think its anything specific to this plugin.
The odd thing is that despite the errors, I still get the generated email when the file finishes uploading and on the front end, nothing seems amiss.
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?I got a test snippet to work so I think I am good there. I did notice this in the console log when I loaded the page using the File Upload Plugin:
Also, the files successfully upload and the Plugin shows the “File name” successfully uploaded message when it finishes the upload.
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?OK it seems no snippets will run for me so let me address that and then get back with you.
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?Here is what I tried:
if (!function_exists('wfu_before_file_upload_handler')) { function wfu_before_file_upload_handler($file_path, $file_unique_id) { $_SESSION['wfu_tempfiles'][$file_unique_id] = $file_path; return $file_path; } add_filter('wfu_before_file_upload', 'wfu_before_file_upload_handler', 10, 2); } if (!function_exists('wfu_after_file_upload_handler')) { function wfu_after_file_upload_handler($changable_data, $additional_data) { if ($additional_data['upload_result'] == 'success' && isset($_SESSION['wfu_tempfiles'][$file_unique_id]) && $_SESSION['wfu_tempfiles'][$file_unique_id] != '') { $file_contents = file_get_contents($_SESSION['wfu_tempfiles'][$file_unique_id]); // perform here html extraction $message="TEST MESSAGE nymets1104"; wfu_debug_log($message); // you can set javascript code to run in client browser using $changable_data['js_script'] } return $changable_data; } add_filter('wfu_after_file_upload', 'wfu_after_file_upload_handler', 10, 2); }Not seeing a debug file anywhere in wp-content though
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?So I am certainly screwing something up here but here is what I am trying to do:
Allow User to upload file (small MP4 in my case)
After succesful upload, video is then displayed on the same page that has the file upload link.I have added your code into Code Snippets plugin, but it never seems to trigger?
I even tried calling a simple Echo statement and nothing happens.
Am I going about this the wrong way or did I miss something?
Forum: Plugins
In reply to: [Iptanus File Upload] Possible to use uploaded file after upload is success?Nickolas, does this require the paid version of the plugin or will it work in free one also?