本文整理汇总了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);
}
示例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 );
*/
}
示例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));
}
}
示例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);
}
示例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));
示例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;
}
示例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');
?>
: <input type="radio" value="yes" <?php
if (SendPress_Option::get('try-theme') == 'yes') {
echo "checked='checked'";
}
?>
name="try-theme"> Yes <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
//.........这里部分代码省略.........