當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SendPress_Data::get_template_id_by_slug方法代碼示例

本文整理匯總了PHP中SendPress_Data::get_template_id_by_slug方法的典型用法代碼示例。如果您正苦於以下問題:PHP SendPress_Data::get_template_id_by_slug方法的具體用法?PHP SendPress_Data::get_template_id_by_slug怎麽用?PHP SendPress_Data::get_template_id_by_slug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SendPress_Data的用法示例。


在下文中一共展示了SendPress_Data::get_template_id_by_slug方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send_manage_subscription

 static function send_manage_subscription($subscriberID, $listids, $lists)
 {
     $subscriber = SendPress_Data::get_subscriber($subscriberID);
     $l = '';
     foreach ($lists as $list) {
         if (in_array($list->ID, $listids)) {
             $l .= $list->post_title . " <br>";
         }
     }
     //	add_filter( 'the_content', array( $this, 'the_content') );
     $optin = SendPress_Data::get_template_id_by_slug('double-optin');
     $user = SendPress_Data::get_template_id_by_slug('user-style');
     SendPress_Posts::copy_meta_info($optin, $user);
     $message = new SendPress_Email();
     $message->id($optin);
     $message->subscriber_id($subscriberID);
     $message->remove_links(true);
     $message->purge(true);
     $html = $message->html();
     $message->purge(false);
     $text = $message->text();
     $code = array("id" => $subscriberID, "listids" => implode(',', $listids), "view" => "confirm");
     $code = SendPress_Data::encrypt($code);
     if (SendPress_Option::get('old_permalink') || !get_option('permalink_structure')) {
         $link = home_url() . "?sendpress=" . $code;
     } else {
         $link = home_url() . "/sendpress/" . $code;
     }
     $href = $link;
     $html_href = "<a href='" . $link . "'>" . $link . "</a>";
     $html = str_replace("*|SP:CONFIRMLINK|*", $html_href, $html);
     $text = str_replace("*|SP:CONFIRMLINK|*", $href, $text);
     $text = nl2br($text);
     $sub = $message->subject();
     SendPress_Data::register_event('confirm_sent', $subscriberID);
     SendPress_Manager::send($subscriber->email, $sub, $html, $text, false);
 }
開發者ID:radscheit,項目名稱:unicorn,代碼行數:37,代碼來源:class-sendpress-manager.php

示例2: send_optin

 static function send_optin($subscriberID, $listids, $lists)
 {
     //SendPress_Error::log('send optin');
     $subscriber = SendPress_Data::get_subscriber($subscriberID);
     $l = '';
     $optin_id = 0;
     foreach ($lists as $list) {
         if (in_array($list->ID, $listids)) {
             $l .= $list->post_title . " <br>";
             if ($optin_id === 0) {
                 $o = get_post_meta($list->ID, 'opt-in-id', true);
                 if ($o === "") {
                     $o = 0;
                 }
                 if ($o > 0) {
                     $optin_id = $o;
                 }
             }
         }
     }
     //	add_filter( 'the_content', array( $this, 'the_content') );
     $optin = $optin_id > 0 ? $optin_id : SendPress_Data::get_template_id_by_slug('double-optin');
     $user = SendPress_Data::get_template_id_by_slug('user-style');
     SendPress_Posts::copy_meta_info($optin, $user);
     SendPress_Email_Cache::build_cache_for_system_email($optin);
     $go = array('from_name' => 'queue', 'from_email' => 'queue', 'to_email' => $subscriber->email, 'emailID' => intval($optin), 'subscriberID' => intval($subscriberID), 'subject' => '', 'listID' => 0);
     $id = SendPress_Data::add_email_to_queue($go);
     SPNL()->load("Subscribers_Tracker")->add(array('subscriber_id' => intval($subscriberID), 'email_id' => intval($optin), 'tracker_type' => SendPress_Enum_Tracker_Type::Confirm));
     $confirm_email = SendPress_Data::get_single_email_from_queue_by_id($id);
     SendPress_Email_Cache::build_cache_for_system_email($confirm_email->id);
     $confirm_email->is_confirm = true;
     SendPress_Queue::send_the_queue($confirm_email);
     /*
     $message = new SendPress_Email();
     $message->id($optin);
     $message->subscriber_id($subscriberID);
     $message->remove_links(true);
     $message->purge(true);
     $html = $message->html();
     $message->purge(false);
     $text = $message->text();
     
     $code = array(
     		"id"=>$subscriberID,
     		"listids"=> implode(',',$listids),
     		"view"=>"confirm"
     	);
     $code = SendPress_Data::encrypt( $code );
     
     if( SendPress_Option::get('old_permalink') || !get_option('permalink_structure') ){
     	$link = home_url() ."?sendpress=".$code;
     } else {
     	$link = home_url() ."/sendpress/".$code;
     }
     
     $href = $link;
     $html_href = "<a href='". $link  ."'>". $link  ."</a>";
     
     
     $html = str_replace("*|SP:CONFIRMLINK|*", $html_href , $html );
     $text = str_replace("*|SP:CONFIRMLINK|*", $href , $text );
     $text = nl2br($text);
     $sub =  $message->subject();
     SPNL()->load("Subscribers_Tracker")->add( array('subscriber_id' => intval( $subscriberID ), 'email_id' => intval( $optin), 'tracker_type' => SendPress_Enum_Tracker_Type::Confirm ) );
     //SendPress_Data::register_event( 'confirm_sent', $subscriberID );			
     SendPress_Manager::send( $subscriber->email, $sub , $html, $text, false );
     */
 }
開發者ID:pedro-mendonca,項目名稱:sendpress,代碼行數:68,代碼來源:class-sendpress-manager.php

示例3: set_default_style

 static function set_default_style($id)
 {
     if (false == get_post_meta($id, 'body_bg', true)) {
         $default_styles_id = SendPress_Data::get_template_id_by_slug('user-style');
         if (false == get_post_meta($default_styles_id, 'body_bg', true)) {
             $default_styles_id = SendPress_Data::get_template_id_by_slug('default-style');
         }
         $default_post = get_post($default_styles_id);
         update_post_meta($id, 'body_bg', get_post_meta($default_post->ID, 'body_bg', true));
         update_post_meta($id, 'body_text', get_post_meta($default_post->ID, 'body_text', true));
         update_post_meta($id, 'body_link', get_post_meta($default_post->ID, 'body_link', true));
         update_post_meta($id, 'header_bg', get_post_meta($default_post->ID, 'header_bg', true));
         update_post_meta($id, 'header_text_color', get_post_meta($default_post->ID, 'header_text_color', true));
         //update_post_meta( $id , 'header_text',  get_post_meta( $default_post->ID , 'header_text', true) );
         update_post_meta($id, 'content_bg', get_post_meta($default_post->ID, 'content_bg', true));
         update_post_meta($id, 'content_text', get_post_meta($default_post->ID, 'content_text', true));
         update_post_meta($id, 'sp_content_link_color', get_post_meta($default_post->ID, 'sp_content_link_color', true));
         update_post_meta($id, 'content_border', get_post_meta($default_post->ID, 'content_border', true));
         update_post_meta($id, 'upload_image', get_post_meta($default_post->ID, 'upload_image', true));
     }
 }
開發者ID:radscheit,項目名稱:unicorn,代碼行數:21,代碼來源:class-sendpress-email.php

示例4: jaiminho_define_opt_in_email

 public static function jaiminho_define_opt_in_email()
 {
     $optin = SendPress_Data::get_template_id_by_slug('double-optin');
     $my_post = array('ID' => $optin, 'post_title' => "Por favor responda para entrar na lista de emails da *|SITE:TITLE|*", 'post_content' => "Olá! \n\n\t\t\t\tFalta pouco para podermos enviar para você e-mail do site *|SITE:TITLE|*, mas antes disto precisamos que você confirme que você realmente quer receber nossas informações.\n\n\t\t\t\tSe você quer receber informações do *|SITE:TITLE|* no seu e-mail, você só precisa clicar no linque abaixo. Muito obrigado! \n\t\t\t\t———————————————————————————————————\n\t\t\t\tCONFIRME UTILIZANDO O LINQUE ABAIXO: \n\n\t\t\t\t*|SP:CONFIRMLINK|* \n\n\t\t\t\tClique no linque acima para nos dar permissão de te enviar\n\t\t\t\tinformações. É rápido e fácil! Se você não conseguir clicar, \n\t\t\t\tcopie e cole o linque o seu navegador. \n\t\t\t\t———————————————————————————————————\n\n\t\t\t\tSe você não quiser receber e-mails, simplesmente ignore esta mensagem.");
     wp_update_post($my_post);
 }
開發者ID:redelivre,項目名稱:jaiminho,代碼行數:6,代碼來源:jaiminho.php

示例5: get_post

    if (!defined('SENDPRESS_STYLER_PAGE')) {
        SendPress_Admin::redirect('Emails');
    }
}
$default_styles_id = SendPress_Data::get_template_id_by_slug('user-style');
if (isset($emailID)) {
    if (false == get_post_meta($default_styles_id, 'body_bg', true)) {
        $default_styles_id = SendPress_Data::get_template_id_by_slug('default-style');
    }
    $display_content = $post->post_content;
    //$display_content = apply_filters('the_content', $display_content);
    //$display_content = str_replace(']]>', ']]>', $display_content);
} else {
    $post = get_post($default_styles_id);
    $post_id = $post->ID;
    $default_styles_id = SendPress_Data::get_template_id_by_slug('default-style');
    $display_content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eget libero nisi. Donec pretium pellentesque rutrum. Fusce viverra dapibus nisi in aliquet. Aenean quis convallis quam. Praesent eu lorem mi, in congue augue. Fusce vitae elementum sapien. Vivamus non nisi velit, interdum auctor nulla. Morbi at sem nec ligula gravida elementum. Morbi ornare est et nunc tristique posuere.

Morbi iaculis fermentum magna, <a href="#">nec laoreet erat commodo vel</a>. Donec arcu justo, varius at porta eget, aliquet varius ipsum. Aliquam at lacus magna. Curabitur ullamcorper viverra turpis, vitae egestas mi tincidunt sed. Quisque fringilla adipiscing feugiat. In magna lectus, lacinia in suscipit sit amet, varius sed justo. Suspendisse vehicula, magna vitae porta pretium, massa ipsum commodo metus, eget feugiat massa leo in elit.';
}
$default_post = get_post($default_styles_id);
/*
if(!isset($post)){

	$post = $default_post;
}
*/
if (isset($post) && false == get_post_meta($post->ID, 'body_bg', true)) {
    update_post_meta($post->ID, 'body_bg', get_post_meta($default_post->ID, 'body_bg', true));
    update_post_meta($post->ID, 'body_text', get_post_meta($default_post->ID, 'body_text', true));
    update_post_meta($post->ID, 'body_link', get_post_meta($default_post->ID, 'body_link', true));
開發者ID:radscheit,項目名稱:unicorn,代碼行數:31,代碼來源:email-style.2.0.php

示例6: the_content

 function the_content($content)
 {
     global $post;
     $optin = SendPress_Data::get_template_id_by_slug('double-optin');
     if ($post->post_type == 'sptemplates' && $post->ID == $optin) {
         $content .= "";
     }
     return $content;
 }
開發者ID:pmatheus,項目名稱:participacao-sitebase,代碼行數:9,代碼來源:sendpress.php

示例7: html

        function html($sp)
        {
            $optin = SendPress_Data::get_template_id_by_slug('double-optin');
            $dpost = get_post($optin);
            ?>
		<form method="post" id="post">
<!--
<div style="float:right;" >
	<a href=" " class="btn btn-large btn-default" ><i class="icon-remove"></i> <?php 
            _e('Cancel', 'sendpress');
            ?>
</a> <a href="#" id="save-update" class="btn btn-primary btn-large"><i class="icon-white icon-ok"></i> <?php 
            _e('Save', 'sendpress');
            ?>
</a>
</div>
-->
		<br class="clear">
		<br class="clear">
		<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title"><?php 
            _e('Public Page Settings', 'sendpress');
            ?>
</h3>
  </div>
  <div class="panel-body">
<div class="boxer form-box">
	

	<br><b><?php 
            _e('Use theme styles', 'sendpress');
            ?>
:&nbsp;&nbsp;&nbsp;<input type="radio" value="yes" <?php 
            if (SendPress_Option::get('try-theme') == 'yes') {
                echo "checked='checked'";
            }
            ?>
 name="try-theme"> Yes&nbsp;&nbsp;&nbsp;<input type="radio" value="no" <?php 
            if (SendPress_Option::get('try-theme') == 'no') {
                echo "checked='checked'";
            }
            ?>
 name="try-theme"> <?php 
            _e('No', 'sendpress');
            ?>
</b>
	<br><?php 
            _e('This will attempt to use the WordPress theme functions', 'sendpress');
            ?>
 <code>get_header</code> <?php 
            _e('and', 'sendpress');
            ?>
 <code>get_footer</code> <?php 
            _e('to build the SendPress default public pages', 'sendpress');
            ?>
.
	<br><hr>
	<div class="sp-row">
			<div class="sp-33 sp-first"><b><?php 
            _e('Manage Page', 'sendpress');
            ?>
</b><br>
				<div class='well'>
					<?php 
            _e('This is the page subscribers are directed to to manage their subscriptions to your lists', 'sendpress');
            ?>
.
					<br><br>
					<?php 
            $ctype = SendPress_Option::get('manage-page');
            ?>
					<input type="radio" name="manage-page" value="default" <?php 
            if ($ctype == 'default') {
                echo "checked='checked'";
            }
            ?>
 /> <?php 
            _e('Use Default SendPress Page', 'sendpress');
            ?>
<br><br>
					<input type="radio" name="manage-page" value="custom"  <?php 
            if ($ctype == 'custom') {
                echo "checked='checked'";
            }
            ?>
/> <?php 
            _e('Redirect to', 'sendpress');
            ?>
 
					<select name="manage-page-id"> 
					 	<option value="">
					 	<?php 
            $cpageid = SendPress_Option::get('manage-page-id');
            ?>
						<?php 
            echo esc_attr(__('Select page'));
            ?>
</option> 
						 <?php 
//.........這裏部分代碼省略.........
開發者ID:radscheit,項目名稱:unicorn,代碼行數:101,代碼來源:class-sendpress-view-settings-activation.php


注:本文中的SendPress_Data::get_template_id_by_slug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。