add_my_shortcodes(); } /** * Register shortcodes */ public function add_my_shortcodes() { function blog_name_shortcode() { $blog_name = get_bloginfo('name'); $message = ''.$blog_name.''; return $message; } add_shortcode('blog_name', 'blog_name_shortcode'); function blog_link_shortcode() { $blog_name = get_bloginfo('name'); $blog_url = get_bloginfo('url'); $message = ''.$blog_name.' tīmekļvietne'; return $message; } add_shortcode('blog_link', 'blog_link_shortcode'); function blog_name_and_link_shortcode() { $blog_name = get_bloginfo('name'); $blog_url = get_bloginfo('url'); $message = ''.$blog_name.' tīmekļvietni - '.$blog_url.''; return $message; } add_shortcode('blog_name_and_link', 'blog_name_and_link_shortcode'); function evaluation_date_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yEvaluationDate = get_post_meta( $post_id, 'accessibilityStatement_a11yEvaluationDate', true ); if ($a11yEvaluationDate) { $a11yEvaluationDate = date('d.m.Y', strtotime($a11yEvaluationDate)); } $message = ''.$a11yEvaluationDate.''; return $message; } add_shortcode('evaluation_date', 'evaluation_date_shortcode'); function a11y_author_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yAuthor = get_post_meta( $post_id, 'accessibilityStatement_a11yAuthor', true ); $message = ''.$a11yAuthor.''; return $message; } add_shortcode('a11y_author', 'a11y_author_shortcode'); function a11y_Evaluation_Fits_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yEvaluationFits = get_post_meta( $post_id, 'accessibilityStatement_a11yEvaluationFits', true ); $message = ''; if ($a11yEvaluationFits == 'tīmekļvietne daļēji atbilst MK noteikumiem Nr. 445') { $message = 'daļēji atbilst noteikumiem Nr. 445 turpmāk uzskaitīto iemeslu dēļ.'; }elseif ($a11yEvaluationFits == 'tīmekļvietne pilnīgi atbilst MK noteikumiem Nr. 445') { $message = ' pilnīgi atbilst MK noteikumiem Nr. 445'; } return $message; } add_shortcode('a11y_Evaluation_Fits', 'a11y_Evaluation_Fits_shortcode'); function a11y_Non_Compliance_List_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yEvaluationFits = get_post_meta( $post_id, 'accessibilityStatement_a11yEvaluationFits', true ); $a11yNonComplianceList = get_post_meta( $post_id, 'accessibilityStatement_a11yNonComplianceList', true ); $a11yNonComplianceList = apply_filters( 'the_content', $a11yNonComplianceList ); $message = ''; if ($a11yEvaluationFits == 'tīmekļvietne daļēji atbilst MK noteikumiem Nr. 445') { $message = '

Neatbilstība prasībām, kas minētas noteikumos Nr. 445:

' . $a11yNonComplianceList. '
'; } return $message; } add_shortcode('a11y_Non_Compliance_List', 'a11y_Non_Compliance_List_shortcode'); function what_Are_Alternatives_To_Non_Accessable_Content_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yEvaluationFits = get_post_meta( $post_id, 'accessibilityStatement_a11yEvaluationFits', true ); $whatAreAlternativesToNonAccessableContent = get_post_meta( $post_id, 'accessibilityStatement_whatAreAlternativesToNonAccessableContent', true ); $whatAreAlternativesToNonAccessableContent = apply_filters( 'the_content', $whatAreAlternativesToNonAccessableContent ); $message = ''; if ($a11yEvaluationFits == 'tīmekļvietne daļēji atbilst MK noteikumiem Nr. 445') { $message = '

Piekļūstamības alternatīvas

' . $whatAreAlternativesToNonAccessableContent; } return $message; } add_shortcode('what_Are_Alternatives_To_Non_Accessable_Content', 'what_Are_Alternatives_To_Non_Accessable_Content_shortcode'); function contact_mail_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yMail = get_post_meta( $post_id, 'accessibilityStatement_a11yMail', true ); $message = ''.$a11yMail.''; return $message; } add_shortcode('contact_mail', 'contact_mail_shortcode'); function contact_phone_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yPhone = get_post_meta( $post_id, 'accessibilityStatement_a11yPhone', true ); // TODO remove spaces $message = ''.$a11yPhone.'.'; return $message; } add_shortcode('contact_phone', 'contact_phone_shortcode'); function other_contacts_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yOtherContacts = get_post_meta( $post_id, 'accessibilityStatement_a11yOtherContacts', true ); $message = ''.$a11yOtherContacts.''; return $message; } add_shortcode('other_contacts', 'other_contacts_shortcode'); function response_time_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yTime = get_post_meta( $post_id, 'accessibilityStatement_a11yTime', true ); $message = ''.$a11yTime.''; return $message; } add_shortcode('response_time', 'response_time_shortcode'); function complaints_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yComplaints = get_post_meta( $post_id, 'accessibilityStatement_a11yComplaints', true ); $message = ''.$a11yComplaints.' '; return $message; } add_shortcode('complaints', 'complaints_shortcode'); function first_notify_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yFirstNotify = get_post_meta( $post_id, 'accessibilityStatement_a11yFirstNotify', true ); if ($a11yFirstNotify) { $a11yFirstNotify = date('d.m.Y', strtotime($a11yFirstNotify)); } $message = ''.$a11yFirstNotify.''; return $message; } add_shortcode('first_notify', 'first_notify_shortcode'); function approved_by_name_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yApprovedBy = get_post_meta( $post_id, 'accessibilityStatement_a11yApprovedBy', true ); $message = ''.$a11yApprovedBy.''; return $message; } add_shortcode('approved_by_name', 'approved_by_name_shortcode'); function approved_by_job_title_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $a11yApprovedByJobtitle = get_post_meta( $post_id, 'accessibilityStatement_a11yApprovedByJobtitle', true ); $message = ''.$a11yApprovedByJobtitle.''; return $message; } add_shortcode('approved_by_job_title', 'approved_by_job_title_shortcode'); function has_statement_been_rereviewed_shortcode() { $post_id = get_option( 'a11yStatement_post_id' ); $HasStatementBeenReReviewed = get_post_meta( $post_id, 'accessibilityStatement_HasStatementBeenReReviewed', true ); $a11yRepeatedNotify = get_post_meta( $post_id, 'accessibilityStatement_a11yRepeatedNotify', true ); if ($a11yRepeatedNotify) { $a11yRepeatedNotify = date('d.m.Y', strtotime($a11yRepeatedNotify)); } $message = ''; if ($HasStatementBeenReReviewed) { $message = '

Atkārtoti pārskatīts '.$a11yRepeatedNotify.'.

'; } return $message; } add_shortcode('has_statement_been_rereviewed', 'has_statement_been_rereviewed_shortcode'); function accept_document_shortcode() { $message = ''; $post_id = get_option( 'a11yStatement_post_id' ); $a11yAcceptDocument = get_post_meta( $post_id, 'accessibilityStatement_a11yAcceptDocument', true ); $file_name = get_the_title($a11yAcceptDocument); $file_url = wp_get_attachment_url($a11yAcceptDocument); if ($file_name && $file_url) { $message = ''.$file_name.''; } return $message; } add_shortcode('accept_document', 'accept_document_shortcode'); } }