post_title; } /* * Derive the new Title from the IPTC Object Name, if present. * You can use MLAOptions::mla_get_data_source() to get anything available. */ $my_setting = array( 'data_source' => 'template', 'meta_name' => '([+iptc:2#005+])', 'option' => 'raw' ); $object_name = trim( MLAOptions::mla_get_data_source( $post_id, 'single_attachment_mapping', $my_setting, NULL ) ); if ( ! empty( $object_name ) ) { $object_link = strtolower( str_replace( array( ' ', '-', '_', '.' ), '-', $object_name ) ); $new_title = sprintf( ' %2$s ', $object_link, $object_name ); $new_jig_link = sprintf( 'http://www.jeffreyhdean.jhddevelopment.dev/portfolio/%1$s/', $object_link ); if ( $old_value != $new_title ) { $updates[ 'post_title' ] = $new_title; // Create or add to the custom field updates if ( empty( $updates[ 'custom_updates' ] ) ) { $updates[ 'custom_updates' ] = array(); } $updates[ 'custom_updates' ][ 'jig_image_link' ] = $new_jig_link; } } return $updates; } // mla_mapping_updates_filter } //MLAjhdeanMappingHooksExample /* * Install the filters at an early opportunity */ add_action('init', 'MLAjhdeanMappingHooksExample::initialize'); ?>