Skip to content

Commit

Permalink
v 0.1.0
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
Darklg committed Dec 4, 2024
1 parent 96e0ca1 commit f215f1c
Show file tree
Hide file tree
Showing 12 changed files with 429 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
19 changes: 19 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHP Lint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
phplint:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: PHP Lint
uses: michaelw90/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.mo.php
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# wpu_comments_rating
# WPU Comments Rating

[![PHP workflow](https://github.com/WordPressUtilities/wpu_comments_rating/actions/workflows/php.yml/badge.svg 'PHP workflow')](https://github.com/WordPressUtilities/wpu_comments_rating/actions)

Allow users to rate in comments.

## Hooks

### wpu_comments_rating__post_types

- Select the post types where the rating is enabled.

### wpu_comments_rating__star_icon_vote

- HTML for the star icon.

### wpu_comments_rating__rating_position

- Position of the rating in the text comment : `before`, `after`.

## Helpers

## wpu_comments_rating__get_rating_html

```php
echo wpu_comments_rating__get_rating_html();
```
34 changes: 34 additions & 0 deletions assets/note.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@charset "UTF-8";

/* ----------------------------------------------------------
Note
---------------------------------------------------------- */

.wpu-comment-note__wrapper {
z-index: 1;
position: relative;
}

.wpu-comment-note {
display: inline-block;
z-index: 1;
position: relative;
height: 1em;
line-height: 1;
white-space: nowrap;
}

.wpu-comment-note__metas {
z-index: 1;
position: absolute;
top: 0;
left: -999vw;
}

.wpu-comment-note__val {
z-index: 1;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php // Silence is Golden
1 change: 1 addition & 0 deletions lang/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
1 change: 1 addition & 0 deletions lang/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php /* Silence */
2 changes: 2 additions & 0 deletions lang/wpu_comments_rating-fr_FR.l10n.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['Allow users to rate in comments.'=>'Permettez aux utilisateurs de noter dans les commentaires.','Global note'=>'Note globale','Rating'=>'Note','Rating : %s'=>'Note : %s','Number of ratings : %d'=>'Nombre de notes : %d'],'language'=>'fr_FR','x-generator'=>'Poedit 3.5'];
Binary file added lang/wpu_comments_rating-fr_FR.mo
Binary file not shown.
48 changes: 48 additions & 0 deletions lang/wpu_comments_rating-fr_FR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
msgid ""
msgstr ""
"Project-Id-Version: WPU Comments Rating\n"
"POT-Creation-Date: 2024-12-04 22:33+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-KeywordsList: __;_x;_e\n"
"X-Generator: Poedit 3.5\n"
"X-Poedit-SearchPath-0: ../.\n"
"X-Poedit-SearchPathExcluded-0: inc/WPUBaseAdminDatas\n"
"X-Poedit-SearchPathExcluded-1: inc/WPUBaseAdminPage\n"
"X-Poedit-SearchPathExcluded-2: inc/WPUBaseCron\n"
"X-Poedit-SearchPathExcluded-3: inc/WPUBaseEmail\n"
"X-Poedit-SearchPathExcluded-4: inc/WPUBaseFields\n"
"X-Poedit-SearchPathExcluded-5: inc/WPUBaseFileCache\n"
"X-Poedit-SearchPathExcluded-6: inc/WPUBaseMessages\n"
"X-Poedit-SearchPathExcluded-7: inc/WPUBaseSettings\n"
"X-Poedit-SearchPathExcluded-8: inc/WPUBaseToolbox\n"
"X-Poedit-SearchPathExcluded-9: inc/WPUBaseUpdate\n"

#: .././wpu_comments_rating.php:92
msgid "Allow users to rate in comments."
msgstr "Permettez aux utilisateurs de noter dans les commentaires."

#: .././wpu_comments_rating.php:119
msgid "Global note"
msgstr "Note globale"

#: .././wpu_comments_rating.php:215
msgid "Rating"
msgstr "Note"

#: .././wpu_comments_rating.php:228
#, php-format
msgid "Rating : %s"
msgstr "Note : %s"

#: .././wpu_comments_rating.php:236
#, php-format
msgid "Number of ratings : %d"
msgstr "Nombre de notes : %d"
Loading

0 comments on commit f215f1c

Please sign in to comment.