Skip to content

Commit

Permalink
replace yst with epch (Emilia Projects Comment Hacks)
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jan 23, 2024
1 parent 0429bf7 commit f855b48
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" extend="true">
<element value="yst_comment"/>
<element value="epch_comment"/>
<element value="EMILIA_COMMENT_HACKS"/>
</property>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion admin/comment-parent.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function load_comment_parent_box() {
* Updates the comment parent field.
*/
public function update_comment_parent() {
$comment_parent = \filter_input( \INPUT_POST, 'yst_comment_parent', \FILTER_VALIDATE_INT );
$comment_parent = \filter_input( \INPUT_POST, 'epch_comment_parent', \FILTER_VALIDATE_INT );
$comment_id = \filter_input( \INPUT_POST, 'comment_ID', \FILTER_VALIDATE_INT );
$action = \filter_input( \INPUT_POST, 'action' );

Expand Down
4 changes: 2 additions & 2 deletions admin/views/comment-parent-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<table class="form-table editcomment">
<tr valign="top">
<td class="first" style="width: 120px;">
<label for="yst_comment_parent"><?php esc_html_e( 'Comment parent:', 'comment-hacks' ); ?></label>
<label for="epch_comment_parent"><?php esc_html_e( 'Comment parent:', 'comment-hacks' ); ?></label>
</td>
<td>
<input type="text" name="yst_comment_parent" size="30" value="<?php echo esc_attr( $comment->comment_parent ); ?>" id="yst_comment_parent" />
<input type="text" name="epch_comment_parent" size="30" value="<?php echo esc_attr( $comment->comment_parent ); ?>" id="epch_comment_parent" />
</td>
</tr>
</table>
Expand Down
18 changes: 9 additions & 9 deletions inc/email-links.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ public function admin_bar_comment_link(): void {
// We can't set the 'href' attribute to the $url as then esc_url would garble the mailto link.
// So we do a nasty bit of JS workaround. The reason we grab the href from the alternate link is
// so browser extensions like the Google Mail one that change mailto: links still work.
echo '<a href="' . \esc_attr( $url ) . '" id="yst_email_commenters_alternate"></a><script>
function yst_email_commenters(e){
var ystEmailCommentersLink = document.getElementById( "yst_email_commenters_alternate" );
echo '<a href="' . \esc_attr( $url ) . '" id="epch_email_commenters_alternate"></a><script>
function epch_email_commenters(e){
var epchEmailCommentersLink = document.getElementById( "epch_email_commenters_alternate" );
e.preventDefault();
if ( ystEmailCommentersLink === null ) {
if ( epchEmailCommentersLink === null ) {
return;
}
window.location = ystEmailCommentersLink.getAttribute( "href" );
window.location = epchEmailCommentersLink.getAttribute( "href" );
}
</script>';

$wp_admin_bar->add_menu(
[
'id' => 'yst-email-commenters',
'id' => 'epch-email-commenters',
'title' => '<span class="ab-icon" title="' . \__( 'Email commenters', 'comment-hacks' ) . '"></span>',
'href' => '#',
'meta' => [ 'onclick' => 'yst_email_commenters(event)' ],
'meta' => [ 'onclick' => 'epch_email_commenters(event)' ],
]
);
}
Expand All @@ -106,13 +106,13 @@ public function wp_head_css(): void {

echo '
<style>
#wpadminbar #wp-admin-bar-yst-email-commenters .ab-icon {
#wpadminbar #wp-admin-bar-epch-email-commenters .ab-icon {
width: 20px !important;
height: 28px !important;
padding: 6px 0 !important;
margin-right: 0 !important;
}
#wpadminbar #wp-admin-bar-yst-email-commenters .ab-icon:before {
#wpadminbar #wp-admin-bar-epch-email-commenters .ab-icon:before {
content: "\f466";
}
</style>';
Expand Down

0 comments on commit f855b48

Please sign in to comment.