Title: dan.stefan's Replies | WordPress.org

---

# dan.stefan

  [  ](https://wordpress.org/support/users/danstefan/)

 *   [Profile](https://wordpress.org/support/users/danstefan/)
 *   [Topics Started](https://wordpress.org/support/users/danstefan/topics/)
 *   [Replies Created](https://wordpress.org/support/users/danstefan/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/danstefan/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/danstefan/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/danstefan/engagements/)
 *   [Favorites](https://wordpress.org/support/users/danstefan/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Pods - Custom Content Types and Fields] Display : error with the_fields()](https://wordpress.org/support/topic/display-error-with-the_fields/)
 *  Plugin Contributor [dan.stefan](https://wordpress.org/support/users/danstefan/)
 * (@danstefan)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/display-error-with-the_fields/#post-14577729)
 * Hi adeline8ope,
 * You can’t use the_ID() to retrieve an id value, you must use get_the_ID() instead.
   the_ID echoes out the post id.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Pods - Custom Content Types and Fields] Conflict with Dynamic Caching with SG Optimzer](https://wordpress.org/support/topic/conflict-with-dynamic-caching-with-sg-optimzer/)
 *  Plugin Contributor [dan.stefan](https://wordpress.org/support/users/danstefan/)
 * (@danstefan)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/conflict-with-dynamic-caching-with-sg-optimzer/#post-14577679)
 * Hi Acal,
 * Pods doesn’t change the cache-control header. It could be pods sessions that 
   is causing this. Try this in your wp-config.php:
 * `define( 'PODS_SESSION_AUTO_START', false );`
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Pods - Custom Content Types and Fields] Save custome field and use it as post date](https://wordpress.org/support/topic/save-custome-field-and-use-it-as-post-date/)
 *  Plugin Contributor [dan.stefan](https://wordpress.org/support/users/danstefan/)
 * (@danstefan)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/save-custome-field-and-use-it-as-post-date/#post-14576709)
 * Hi 0rca,
 * You could use a hook to save it as the pod is saved. Something like this for 
   example, just replace podname with your custom pod type.
 *     ```
       add_filter( 'pods_api_pre_save_pod_item_podname', 'set_custom_date', 10, 2 );
   
       function set_custom_date( array $pieces, bool $is_new_item ): array {
   
       	// get field values: ok
       	$date = $pieces['fields']['custom_date']['value'];
   
       	if ( ! empty( $date ) ) {
       		if ( ! isset( $pieces['fields_active']['post_date'] ) ) {
       			$pieces['fields_active'][] = 'post_date';
       		}
   
       		//make sure that post_title is active
       		if ( ! isset( $pieces['fields_active']['post_date_gmt'] ) ) {
       			$pieces['fields_active'][] = 'post_date_gmt';
       		}
   
       		$pieces['object_fields']['post_date']['value']     = $date;
       		$pieces['object_fields']['post_date_gmt']['value'] = gmdate( 'Y-m-d H:i', strtotime( $date ) );
   
       	}
   
       	return $pieces;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Pods - Custom Content Types and Fields] Problem setting pod title from fields on save](https://wordpress.org/support/topic/problem-setting-pod-title-from-fields-on-save/)
 *  Plugin Contributor [dan.stefan](https://wordpress.org/support/users/danstefan/)
 * (@danstefan)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/problem-setting-pod-title-from-fields-on-save/#post-14576693)
 * Hey fortiernor,
 * You have to make sure post_title is an active field in the pod_array parameter,
   otherwise it is ignored. Something like this works for example.
 *     ```
       add_filter( 'pods_api_pre_save_pod_item_member', 'set_member_title', 10, 2 );
   
       function set_member_title( array $pod_array, bool $is_new_item ): array {
   
       	if ( ! $is_new_item ) {
       		return $pod_array;
       	}
   
       	// get field values: ok
       	$name      = $pod_array['fields']['lastname']['value'];
       	$firstname      = $pod_array['fields']['firstname']['value'];
       	$org      = $pod_array['fields']['org']['value'];
   
       	if ( ! empty( $org ) ) {
       		$title = $org;
       	} else {
       		$title = $firstname . ' ' . $name;
       	}
   
       	//make sure that post_title is active
       	if ( ! isset( $pod_array['fields_active'][ 'post_title' ] ) ) {
       		$pod_array['fields_active'][] = 'post_title';
       	}
   
       	if ( ! empty( $title )) {
       		$pod_array['object_fields']['post_title']['value'] = $title;
       	}
   
       	return $pod_array;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Gallery] [Plugin: File Gallery] Bug overloading the server](https://wordpress.org/support/topic/plugin-file-gallery-bug-overloading-the-server/)
 *  Thread Starter [dan.stefan](https://wordpress.org/support/users/danstefan/)
 * (@danstefan)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-file-gallery-bug-overloading-the-server/#post-2574593)
 * Great! I’m mostly glad it was not a conflict with other plugins, I was quite 
   stumped to see such high cpu usages at first with no aparent reason(my first 
   possible suspect was thumbnail regeneration, but that worked as expected).
 * Basically including the whole js file is no problem in my oppinion, as long as
   it doesn’t try to start something too big, anyways glad I could help. Maybe I
   get time further on and I can also help with this plugin since it’s quite awesome(
   great job btw).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Gallery] [Plugin: File Gallery] Bug overloading the server](https://wordpress.org/support/topic/plugin-file-gallery-bug-overloading-the-server/)
 *  Thread Starter [dan.stefan](https://wordpress.org/support/users/danstefan/)
 * (@danstefan)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-file-gallery-bug-overloading-the-server/#post-2574559)
 * @Aesque’s second post: No that was not the case, nor the problem. It happened
   on the edit.php page inside the admin. This is a bug, I removed everything other
   plugin from the server and it still used 100% cpu for about 4-5 minutes(it was
   just a development server, but my production server has a lot more images).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Gallery] [Plugin: File Gallery] Bug overloading the server](https://wordpress.org/support/topic/plugin-file-gallery-bug-overloading-the-server/)
 *  Thread Starter [dan.stefan](https://wordpress.org/support/users/danstefan/)
 * (@danstefan)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-file-gallery-bug-overloading-the-server/#post-2574558)
 * Actually the code for it is ran on the post listing pages too. You call the file_gallery_load
   action every time you call file_gallery.init(). Inside that action, you specifically
   call a require_once(‘main-form.php’). AFAIK the form is displayed only on the
   edit pages, however the ajax call is done on the admin post listings too since
   file-gallery.js is included on those pages.
 * I was a wrong above in saying it’s included on all pages, it’s just included 
   on post listing/editing screens, but while running on the post listing pages 
   it overloads the server with requests(in the case of large media libraries)

Viewing 7 replies - 1 through 7 (of 7 total)