Add new keyword
-
Hello,
i modified your plugin to use the post content of the image. Is it possible to add and commit it to your code? Since it gets overriden everytime you update the plugin. See variable $imageContent.
private function parseText($text){ $user = wp_get_current_user(); $date = !empty($this->settings['general']['date_format']) ? $this->settings['general']['date_format'] : get_option('date_format'); $time = !empty($this->settings['general']['time_format']) ? $this->settings['general']['time_format'] : get_option('time_format'); if(is_object($this->currentImage)){ $author = get_user_by('id', $this->currentImage->post_author); $imageTitle = $this->currentImage->post_title; $imageAlt = get_post_meta($this->currentImage->ID, '_wp_attachment_image_alt', true); $imageContent = $this->currentImage->post_content; } else { $author = $user; $imageTitle = '(image title here)'; $imageAlt = '(image alt here)'; $imageContent = '(image content here)'; } $placeholders = array( '%user%', '%user_name%', '%user_email%', '%user_url%', '%author%', '%author_name%', '%author_email%', '%author_url%', '%admin_email%', '%blog_name%', '%blog_url%', '%date%', '%time%', '%image_title%', '%image_alt%', '%image_content%', ); $replacements = array( $user->user_login, $user->display_name, $user->user_email, $user->user_url, $author->user_login, $author->display_name, $author->user_email, $author->user_url, get_bloginfo('admin_email'), get_bloginfo('name'), home_url(), date($date), date($time), $imageTitle, $imageAlt, $imageContent ); return str_replace($placeholders, $replacements, $text); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Add new keyword’ is closed to new replies.