Skip to content

Commit da269ae

Browse files
committed
docs updated
1 parent 94fffca commit da269ae

File tree

3 files changed

+27
-60
lines changed

3 files changed

+27
-60
lines changed

docs/comfortjob/code-samples.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,26 @@ card: "article"
1414
## Add a Job Programmatically
1515

1616
```php
17-
use Comfort\Job\Helpers\ComfortJobHelpers;
17+
<?php
18+
use Comfort\Job\Models\ComfortJob;
19+
20+
$currentDate = gmdate( 'Y-m-d' ); // Get the current date
21+
$expiry_date = gmdate( 'Y-m-d', strtotime( $currentDate . " +$listing_duration days" ) );
1822

1923
// Add a new job
2024
$job_data = [
21-
'title' => 'Software Engineer',
22-
'description' => 'We are looking for a skilled software engineer.',
23-
'status' => 'published',
24-
'salary' => '5000',
25-
'company_id' => 1,
25+
'title' => 'Software Engineer',
26+
'slug' => 'software-engineer',
27+
'description' => 'We are looking for a skilled software engineer.',
28+
'status' => 'published',
29+
'salary_amount' => '5000',
30+
'company_id' => 1,
31+
'owner' => 1,
32+
'expiry_date' => $expiry_date,
33+
'add_by' = 1,
34+
'add_date' = gmdate( 'Y-m-d H:i:s' );
2635
];
27-
$new_job = ComfortJobHelpers::addJob($job_data);
36+
$new_job = ComfortJob::create($job_data);
2837
```
2938

3039
## Fetch Job Listings
@@ -33,7 +42,7 @@ $new_job = ComfortJobHelpers::addJob($job_data);
3342
use Comfort\Job\Helpers\ComfortJobHelpers;
3443

3544
// Get all published jobs
36-
$jobs = ComfortJobHelpers::getJobs([
45+
$jobs = ComfortJobHelpers::jobListing([
3746
'status' => 'published',
3847
'limit' => 10,
3948
]);
@@ -55,17 +64,6 @@ file_put_contents('job_' . $job_id . '.json', $json_data);
5564

5665
# Comfort Job Pro Addon – Code Samples
5766

58-
## Bookmark a Job
59-
60-
```php
61-
use Comfort\JobPro\Helpers\JobProHelpers;
62-
63-
// Bookmark a job for a user
64-
$user_id = get_current_user_id();
65-
$job_id = 123;
66-
$result = JobProHelpers::bookmarkJob($user_id, $job_id);
67-
```
68-
6967
## Manage Company Pages
7068

7169
```php

docs/comfortjob/user-guide/job-tags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ card: "article"
1313
### Job Tags
1414

1515
1. Go to `Comfort Job > Job Tags`.
16-
2. Add new job tags by filling in the name and description.
16+
2. Add new job tags by filling in the name field.
1717
3. Save changes.
1818

1919

docs/comfortjobapp/code-samples.md

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,7 @@ do_action( 'comfortjobapp_apply_job_form_after', $form_id, $job_id, $job, $field
3434

3535
Retrieve a list of application forms for the current user.
3636

37-
```
38-
<?php
39-
$forms = comfortjobapp_get_application_forms([
40-
'limit' => 10,
41-
'page' => 1,
42-
'created_by' => get_current_user_id(),
43-
]);
44-
45-
foreach ( $forms as $form ) {
46-
echo esc_html( $form['title'] );
47-
}
48-
```
49-
### 3. Enqueue Public Scripts
50-
Enqueue public-facing scripts and pass JS translations.
51-
52-
```
37+
```php
5338
<?php
5439
$forms = comfortjobapp_get_application_forms([
5540
'limit' => 10,
@@ -62,17 +47,17 @@ foreach ( $forms as $form ) {
6247
}
6348
```
6449

65-
### 4. Delete an Application
50+
### 3. Delete an Application
6651
Delete an application by ID.
67-
```
52+
```php
6853
<?php
6954
comfortjobapp_delete_application( $application_id );
7055
```
7156

72-
### 5. Delete a Form
57+
### 4. Delete a Form
7358

7459
```php
75-
// Delete a form by ID (ComfortJobApp)
60+
// Delete a form by ID
7661
$result = comfortjobapp_delete_form($form_id);
7762
```
7863

@@ -81,7 +66,7 @@ $result = comfortjobapp_delete_form($form_id);
8166
### 1. Add Employer Dashboard Menu
8267
Add a custom menu to the employer dashboard.
8368

84-
```
69+
```php
8570
<?php
8671
add_filter( 'comfortjobapp_employer_dashboard_menus', function( $menus ) {
8772
$menus['custom_menu'] = [
@@ -100,34 +85,18 @@ function custom_menu_callback() {
10085
### 2. Filter Application Steps
10186
Modify the application steps for the job application process.
10287

103-
```
88+
```php
10489
<?php
10590
add_filter( 'comfortjobapp_steps', function( $steps ) {
10691
$steps['custom_step'] = esc_html__( 'Custom Step', 'comfortjobapppro' );
10792
return $steps;
10893
} );
10994
```
11095

111-
### 3. Custom Email Notification
112-
Customize the email notification sent to applicants.
113-
114-
```
115-
<?php
116-
add_filter( 'comfortjobapp_email_template', function( $template, $application ) {
117-
$template['subject'] = esc_html__( 'Thank you for applying!', 'comfortjobapppro' );
118-
$template['body'] = sprintf(
119-
esc_html__( 'Dear %s, thank you for applying for the %s position.', 'comfortjobapppro' ),
120-
$application['candidate_name'],
121-
$application['job_title']
122-
);
123-
return $template;
124-
}, 10, 2 );
125-
```
126-
127-
### 4. Export Application Data
96+
### 3. Export Application Data
12897
Export application data in JSON format.
12998

130-
```
99+
```php
131100
<?php
132101
add_action( 'admin_post_export_applications', function() {
133102
$applications = ComfortJobApp::query()->get()->toArray();

0 commit comments

Comments
 (0)