Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wpsight_listing_title_actions', 'wpsight_listing_title_action_contact' );
- function wpsight_listing_title_action_contact( $actions ) {
- $args = array(
- 'include' => $include,
- 'post_status' => 'inherit',
- 'post_type' => 'attachment',
- 'post_mime_type' => 'application/pdf',
- 'order' => $order,
- 'orderby' => $orderby
- );
- $args = apply_filters( 'wpsight_image_slider_args', $args);
- $_attachments = get_posts( $args );
- $attachments = array();
- $postid = get_the_ID();
- $url = 'leer';
- foreach ( $_attachments as $k => $v ) {
- $attachments[$v->ID] = $_attachments[$k];
- //print_r($attachments[$v->ID]);
- if($postid == $attachments[$v->ID]->post_parent){
- $url = $attachments[$v->ID]->guid;
- }
- }
- if($url == 'leer'){
- $url = esc_url( add_query_arg( array( 'pid' => get_the_ID(), 'print' => '1' ), get_permalink() ) );
- }
- $actions = array(
- 'favorites' => array(
- 'label' => __( 'Save', 'wpsight' ),
- 'name' => false,
- 'id' => false,
- 'class' => 'btn btn-mini actions-favorites action-link',
- 'href' => false,
- 'target' => false,
- 'icon' => 'icon-star',
- 'atts' => false,
- 'position' => 10,
- 'cb' => 'wpsight_listing_title_action_favorite'
- ),
- 'print' => array(
- 'label' => __( 'Print', 'wpsight' ),
- 'name' => false,
- 'id' => false,
- 'class' => 'btn btn-mini',
- //'href' => esc_url( add_query_arg( array( 'pid' => get_the_ID(), 'print' => '1' ), get_permalink() ) ),
- 'href' => $url,
- 'target' => 'blank',
- 'icon' => 'icon-print',
- 'atts' => false,
- 'position' => 20,
- 'cb' => false
- )
- );
- return $actions;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement